isexecutorclosure
Returns whether the given function was created by the executor.
function isexecutorclosure(func: function): booleanSynopsis
How it works
The executor tags closures created in its environment with an internal marker (typically by checking the closureClosureA function value that captures its lexical environment. In Luau, closures come in two types: LClosure (Luau bytecode + Proto + upvalues) and CClosure (native C function pointer + upvalues).'s environment pointer or thread identityThread identityA numeric privilege level (0–8) assigned to each Luau thread. Determines which Roblox APIs are accessible. Identity 2 = LocalScript, 3 = server Script, 6+ = CoreScript/Plugin level. Executors typically use identity 8. at creation time).
isexecutorclosure checks for this marker. Both Luau closures loaded by the executor and C closures created via newcclosure will return true.Detection context
Game anti-cheatAnti-cheatGame-side Luau scripts designed to detect and prevent exploitation. Common checks: verifying closure types (iscclosure), checking metatable integrity, monitoring remote call patterns, and scanning for known executor globals. scripts may check if unexpected closures in their environment are executor-owned. Conversely, executor scripts use this to verify their own hooks haven't been tampered with.
isexecutorclosure(print) returns false because print is a Roblox-owned C function.Usage
Identify executor closures
local myFunc = function() end
print(isexecutorclosure(myFunc)) "cc">--> true
print(isexecutorclosure(print)) "cc">--> falseParameters
func function The function to inspect.
Returns
boolean true if the function originates from executor-space.
Aliases
Also available as checkclosure and isourclosure on some executors.