Yuari
Documentation
Docs/Debug/restoreproto

restoreproto(proto)

Removes a proto hook installed by hookproto.

Syntax

restoreproto(proto: function) -> boolean

Parameters

ParameterTypeDescription
protofunctionSame handle passed to hookproto.

Returns

TypeDescription
booleantrue when a hook was removed.

Description

Restores the original instruction stream, constants and cached closure stack sizes, then releases the hook reference.

Returns false when the proto is not currently hooked.

Example

local proto = debug.getproto(outer, 1)
hookproto(proto, function() end)
print(restoreproto(proto)) -- true
print(restoreproto(proto)) -- false