Volt

isfunctionhooked

Checks if a function has been hooked.

Syntax

isfunctionhooked(func: function) -> boolean

Parameters

ParameterTypeDescription
funcfunctionThe function to check

Returns

TypeDescription
booleanTrue if the function is hooked

Description

isfunctionhooked checks whether a function has been replaced using hookfunction or similar hooking methods.

Example

local function myFunc()
    return "original"
end

print(isfunctionhooked(myFunc)) -- false

hookfunction(myFunc, function()
    return "hooked"
end)

print(isfunctionhooked(myFunc)) -- true

Use Cases

  • Checking if a function has already been hooked
  • Avoiding double-hooking
  • Debugging hook states

On this page