isprotohooked
Check whether a proto is hooked.
Syntax
isprotohooked(proto: ProtoProxy) -> booleanParameters
| Parameter | Type | Description |
|---|---|---|
proto | ProtoProxy | Proto to check |
Returns
| Type | Description |
|---|---|
boolean | true if the proto is hooked; otherwise false |
Example
local function container()
local function nested()
return 1
end
return nested
end
local proto = debug.getproto(container, 1)
print(isprotohooked(proto)) -- false
hookproto(proto, function()
return 2
end)
print(isprotohooked(proto)) -- true
restoreproto(proto)
print(isprotohooked(proto)) -- falseRelated Functions
hookproto- Hook a protorestoreproto- Restore a hooked protoProtoProxy- Learn about proto proxies