Cache

cloneref

Pushes a new Instance reference for the same same underlying Instance and returns it.

Syntax

cloneref(instance: Instance): Instance
Aliases clonereference

Arguments

NameTypeDescription
instanceInstanceInstance object used as the source for the new reference.

Returns

NameTypeDescription
referenceInstanceInstance reference returned after Instance cache runs with the original Instance reference.

Description

Pushes a new Instance reference for the same same underlying Instance and returns it.

Call it with 1 parameter(s): instance. The argument table explains which values are required and which ones only refine the behavior.

It returns reference (Instance). Use the returns table to separate successful values from nil results and recoverable errors.

Example

Create another Instance reference from an existing Instance userdata.

local Players = game:GetService("Players")

local reference = cloneref(Players)
print(reference)

local sameAlias = clonereference(Players)
print(sameAlias)