ProtoProxy
Represents a nested Luau proto. It does not create an active closure.
Creation
debug.getproto returns a ProtoProxy by default. debug.getprotos returns an array of them.
Properties
proxy.CodeHash: numberCodeHash is a signed 32-bit hash of the proto's instructions. Use it to compare proxies on the same executor version. It is not cryptographic.
Supported Functions
A ProtoProxy can be passed to:
debug.getprotoanddebug.getprotosdebug.getconstantanddebug.getconstantsdebug.setconstantdebug.getinfoanddebug.setinfo- Luau's
debug.info hookprotorestoreprotoisprotohooked
Calling a ProtoProxy returns no values. It does not run the nested function.
local function outer()
local function inner()
return "value"
end
return inner
end
local proxy = debug.getproto(outer, 1)
print(typeof(proxy)) -- ProtoProxy
print(proxy.CodeHash)
print(proxy()) -- nil; the nested function is not executedRelated Functions
debug.getproto- Get one nested protodebug.getprotos- Get every nested protohookproto- Hook a nested proto