ReferenceClosures

isprotohooked

Checks whether a prototype is currently hooked. It returns false for functions that were never hooked, including C functions.

Syntax

isprotohooked(proto: function) -> boolean

Parameters

ParameterTypeDescription
protofunctionA function from debug.getproto.

Returns

TypeDescription
booleantrue while the prototype is hooked with hookproto.

Example

local function outer()
    local function inner() end
    return inner
end
local proto = debug.getproto(outer, 1)
print(isprotohooked(proto))
hookproto(proto, function() end)
print(isprotohooked(proto))
restoreproto(proto)

These are Game executor contracts. Check build requirements and session lifetimes before using them.