getinstancebyid
Finds a live instance wrapper by ID.
Syntax
Signature
getinstancebyid(Id: string) -> Instance?Aliases
getinstancefromid
Parameters
| Parameter | Type | Description |
|---|---|---|
Id | string | Exact instance identifier string. |
Returns
| Type | Description |
|---|---|
Instance? | Matching live wrapper, or nil. |
Notes
Searches live wrappers in the associated host VM for an exact _id string. Reference proxies are skipped. Returns nil when no matching wrapper is found.
Example
Luau
local Instance = getinstances()[1]
assert(Instance, "No instances available")
print(getinstancebyid(Instance._id))