debug.decompile

Dumps a function's bytecode as hexadecimal text.

Syntax

Signature
debug.decompile(FunctionOrLevel: function | number) -> string

Aliases

This function has no aliases.

Parameters

ParameterTypeDescription
FunctionOrLevelfunction | numberLuau closure or positive stack level.

Returns

TypeDescription
stringHexadecimal bytecode dump.

Notes

It does not return source code. Use the global decompile function when source recovery is needed.

Example

Luau
local Function = function() local Message = "Hello" return Message end
local Result = debug.decompile(Function)
print(Result)