Open checkcallerOpen checkclosureOpen clonefuncOpen comparefunctionOpen debug.tracebackOpen getfunctionhashOpen hookfuncOpen hookmetamethodOpen iscclosureOpen islclosureOpen isstackhiddenOpen loadstringOpen newcclosureOpen restoreclosureOpen trampolinecall

Reference

Closures

Create, inspect, clone and hook functions.

27 functions
FunctionSummary
checkcallercheck_callerTells a hook who called it: your own script, or the game.
cloneclosureThe same function as clonefunction, under another name.
clonefunctionclonefuncclone_functionMakes a copy of a function that is a different value but behaves the same.
comparefunctioncomparefunctionsChecks whether two functions are the same underlying function, even when one is a copy.
get_original_threadoth.get_original_threadReturns the waiting caller thread from inside an oth hook.
getfunctionhashget_function_hashReturns a hash that identifies a Luau function's code.
hookfunctionhookfuncreplaceclosurehook_func+2Replaces a function in place, so every existing reference to it runs your hook instead.
hookmetamethodhook_meta_methodHooks one metamethod of an object's metatable.
hookprotoMakes every closure created from the prototype after this call run hook's body instead of its own.
iscclosureis_c_closureChecks whether a function is implemented in C rather than written in Luau.
isexecutorclosurecheckclosureisexecutorfunctionisourclosure+3Checks whether a function was created by your code or by Apex, rather than by the game.
isfunctionhookedisfunchookedis_function_hookedChecks whether a function is currently hooked.
islclosureisluaclosureis_l_closureChecks whether a function is written in Luau rather than implemented in C.
isnewcclosureiscustomcclosureChecks whether a C function is a wrapper made by newcclosure.
isprotohookedChecks whether a prototype is currently hooked.
isstackhiddenis_stack_hiddenReads the hidden-frame mark for a function or visible caller level.
loadstringload_stringCompiles Luau source into a function you can call.
newcclosurenew_c_closureWraps a Luau function in a C function.
newlclosurenew_l_closureWraps any function in a new Luau function.
oth.get_root_callbackReturns the hook function associated with the current oth hook context.
oth.hookInstalls a hook whose body runs in a separate task while the caller waits for its results.
oth.is_hook_threadReports whether the current task is executing an oth hook body.
oth.unhookRemoves an oth hook from a function.
restorefunctionrestoreclosurerestorefuncrestore_functionUndoes hookfunction, giving a hooked function its original behavior back.
restoreprotoUndoes hookproto.
setstackhiddenset_stack_hiddenControls whether a function’s frames appear in Apex’s supported stack-inspection views.
trampoline_calltrampolinecallCalls a function as if it had been called from a different place.