isexecutorclosure
Checks whether a function was created by your code or by Apex, rather than by the game.
Syntax
isexecutorclosure(func: function) -> boolean
Also available as
checkclosureisexecutorfunctionisourclosurecheck_closureis_executor_closureis_our_closure
Parameters
| Parameter | Type | Description |
|---|---|---|
func | function | The function to check. |
Returns
| Type | Description |
|---|---|
boolean | true when the function belongs to Apex or to code you ran, false when it belongs to the game. |
Description
Luau functions count as yours when they were compiled from code you ran, including code loaded with loadstring. C functions count as yours when Apex provides them, such as hookfunction itself or a wrapper from newcclosure. Game functions and engine built-ins return false.
Example
print(isexecutorclosure(isexecutorclosure))
print(isexecutorclosure(function() end))
print(isexecutorclosure(print))
print(isexecutorclosure(loadstring("return 1")))
Notes
- Engine built-ins such as
printare the game's functions even when you call them, so they returnfalse.
These are Game executor contracts. Check build requirements and session lifetimes before using them.
