Returns true when fn currently has a hook installed on it by hookfunction, hookmetamethod, or oth.hook.

Parameters

function
required
The function to check.

Returns

boolean
true if a hook is active on fn, false otherwise.

Behavior

  • All three hook kinds count. Athena keeps a separate registry for plain function hooks, metamethod hooks, and oth thread hooks. isfunctionhooked reports true if fn appears in any of them.
  • It tracks the hook, not the target name. The result is true between the hooking call and the matching restore (restorefunction, restoremetamethod, or oth.unhook), and false at all other times.

Example

Errors