compareinstances
Check if two Instance references point to the same underlying object.
function compareinstances(object1object1InstanceThe first Instance to compare.: Instance, object2object2InstanceThe second Instance to compare against.: Instance): booleanbooleantrue if both references point to the same underlying game Instance.Usage
Equality with cloneref
print(compareinstances(game, game)) -- true
print(compareinstances(game, workspace)) -- false
print(compareinstances(game, cloneref(game))) -- true
print(game == cloneref(game)) -- false