cloneref
Creates another reference to an instance wrapper.
Syntax
Signature
cloneref(Instance: Instance) -> InstanceAliases
This function has no aliases.
Parameters
| Parameter | Type | Description |
|---|---|---|
Instance | Instance | Instance wrapper with an _id field. |
Returns
| Type | Description |
|---|---|
Instance | New table proxy for the original wrapper. |
Notes
Creates a separate table proxy that forwards field reads and writes to the original instance wrapper. It does not create another scene object. compareinstances recognizes the original and proxy as the same instance, while rawequal sees different tables.
Example
Luau
local Original = game:GetService("Players")
local Reference = cloneref(Original)
assert(compareinstances(Original, Reference))
print(rawequal(Original, Reference))