ReferenceClosures

cloneclosure

The same function as clonefunction, under another name. The copy runs the original's code with its own identity, so hooking or restoring one does not change the other.

Syntax

cloneclosure(target: function) -> function

Parameters

ParameterTypeDescription
targetfunctionThe function to copy.

Returns

TypeDescription
functionA copy that behaves like the original.

Example

local copy = cloneclosure(print)
print(copy == print)

These are Game executor contracts. Check build requirements and session lifetimes before using them.