instance - Roblox treats both as the same Instance.
cloneref(game:GetService("CoreGui")). Considered industry-standard for all scripts written in a Roblox Executor context. See more here.
Parameters
Returns
Instance
Aliases
clonereference
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
instance - Roblox treats both as the same Instance.
cloneref(instance: Instance): Instance
cloneref(game:GetService("CoreGui")). Considered industry-standard for all scripts written in a Roblox Executor context. See more here.
| Parameter | Type | Description |
|---|---|---|
instance | Instance | The Instance to clone. |
Instance
clonereferencelocal fake_players = cloneref(game:GetService("Players"))
local real_players = game:GetService("Players")
print(compareinstances(fake_players, real_players) -- uh false? I forgot
local rs = cloneref(game:GetService("CoreGui"))
for _, child in rs:GetChildren() do
print(child.Name)
end
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.