compareinstances
Compares two instances by identity.
Syntax
compareinstances(a: any, b: any) -> boolean
Parameters
| Parameter | Type | Description |
|---|---|---|
a | any | The a value used by the call. |
b | any | The b value used by the call. |
Returns
| Type | Description |
|---|---|
boolean | The boolean result of the check. |
Description
compareinstances is part of the Cache library. The module keeps a stable instance cache so userdata survives Roblox object churn. Cache calls inspect or change that mapping without modifying the game object itself.
The call is read-only: it resolves the current value when invoked and does not change the underlying state.
Example
print(compareinstances(workspace, game:GetService("Workspace")))
Notes
- Cache changes affect future lookups; existing userdata references remain valid.