isexecutorclosure
Checks if a function originates from volt.
Syntax
isexecutorclosure(func: function) -> booleanParameters
| Parameter | Type | Description |
|---|---|---|
func | function | The function to check |
Returns
| Type | Description |
|---|---|
boolean | true if the function is from volt, false otherwise |
Description
isexecutorclosure determines whether a function was created by or is part of volt's environment. This includes both volt-provided functions (like loadstring, hookfunction) and functions defined in your scripts.
Example
-- Volt functions return true
print(isexecutorclosure(loadstring)) -- true
print(isexecutorclosure(hookfunction)) -- true
-- Your script functions return true
local function myFunc()
return "hello"
end
print(isexecutorclosure(myFunc)) -- true
-- Game functions return false
print(isexecutorclosure(print)) -- false
print(isexecutorclosure(game.GetService)) -- falseRelated Functions
checkcaller- Check if the current call is from volt's threadiscclosure- Check if a function is a C closureislclosure- Check if a function is a Luau closure
Aliases
checkclosureisourclosure