Skip to main content
Returns a separate Lua reference to instance - Roblox treats both as the same Instance.
Commonly written wrapping a service - cloneref(game:GetService("CoreGui")). Considered industry-standard for all scripts written in a Roblox Executor context. See more here.

Parameters

Returns

Instance

Aliases

  • clonereference

Example

Use compareinstances(a, b) to check whether two values are the same Instance - regular == returns false the moment one side has been through cloneref. The cloneref copy and the original point at the same Instance, so changes through either (setting properties, adding children, calling :Destroy()) show up on both.