isprotohooked Synchronous
See whether a ProtoProxy currently has a replacement installed by hookproto. This is useful for idempotent cleanup of nested function patches.
Luau
isprotohooked(target: ProtoProxy) -> booleanParameters
| Parameter | Type | Description |
|---|---|---|
target | ProtoProxy | ProtoProxy to check. |
Returns
booleantrue while the prototype is hooked; otherwise false.
Example
Luau
local function factory() return function() return 1 end end
local proto = debug.getproto(factory, 1)
hookproto(proto, function() return 2 end)
print(isprotohooked(proto)) -- true
restoreproto(proto)