oth. is_hook_thread Synchronous
Report whether the current coroutine is running an OTH callback. Use it to distinguish callback work from ordinary script work.
Luau
oth.is_hook_thread() -> booleanParameters
This function takes no arguments.
Returns
booleantrue inside an OTH hook callback; false outside it.
Usage notes
This reports the current coroutine only. It does not say whether any hooks are installed elsewhere.
Example
Luau
print(oth.is_hook_thread()) -- false outside a callback
local target = newcclosure(function() return "original" end)
local previous = oth.hook(target, function()
print(oth.is_hook_thread()) -- true here
return "hooked"
end)
print(target())
oth.unhook(target, previous)