isprotohooked Synchronous

See whether a ProtoProxy currently has a replacement installed by hookproto. This is useful for idempotent cleanup of nested function patches.

Syntax
Luau
isprotohooked(target: ProtoProxy) -> boolean

Parameters

Function parameters
ParameterTypeDescription
targetProtoProxyProtoProxy to check.

Returns

boolean

true while the prototype is hooked; otherwise false.

Example

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)
Kawaii documentation