getinstancebyid

Finds a live instance wrapper by ID.

Syntax

Signature
getinstancebyid(Id: string) -> Instance?

Aliases

  • getinstancefromid

Parameters

ParameterTypeDescription
IdstringExact instance identifier string.

Returns

TypeDescription
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))