compareinstances
Checks whether two references point at the same Instance, including references made by cloneref.
Syntax
compareinstances(a: Instance, b: Instance) -> boolean
Also available as
compare_instances
Parameters
| Parameter | Type | Description |
|---|---|---|
a | Instance | The first reference. |
b | Instance | The second reference. |
Returns
| Type | Description |
|---|---|
boolean | true when both references point at the same Instance. |
Example
local ref = cloneref(workspace)
print(ref == workspace)
print(compareinstances(ref, workspace))
print(compareinstances(workspace, game))
These are Game executor contracts. Check build requirements and session lifetimes before using them.
