Volt

isexecutorclosure

Checks if a function originates from volt.

Syntax

isexecutorclosure(func: function) -> boolean

Parameters

ParameterTypeDescription
funcfunctionThe function to check

Returns

TypeDescription
booleantrue 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)) -- false
  • checkcaller - Check if the current call is from volt's thread
  • iscclosure - Check if a function is a C closure
  • islclosure - Check if a function is a Luau closure

Aliases

  • checkclosure
  • isourclosure

On this page