Syntax
isfunctionhooked(func: function): booleanArguments
| Name | Type | Description |
|---|---|---|
func | function | Function to check. Passing a non-function raises a type error. |
Returns
| Name | Type | Description |
|---|---|---|
hooked | boolean | true when the function is currently hooked; otherwise false. |
Description
Returns whether the provided function currently has a hook record. The argument must be a function.
Call it with 1 parameter(s): func. The argument table explains which values are required and which ones only refine the behavior.
It returns hooked (boolean). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Check whether a function closure is tracked as a hook target.
local function target()
end
print(isfunctionhooked(target))