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