Yuari
Documentation
Docs/Cache/compareinstances

compareinstances

Compares two instances by identity.

Syntax

compareinstances(a: any, b: any) -> boolean

Parameters

ParameterTypeDescription
aanyThe a value used by the call.
banyThe b value used by the call.

Returns

TypeDescription
booleanThe 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.