decompile

Recovers Luau source from available bytecode.

Syntax

Signature
decompile(Source: Instance | function | string) -> string

Aliases

This function has no aliases.

Parameters

ParameterTypeDescription
SourceInstance | function | stringScript wrapper, Luau closure, or binary Luau bytecode.

Returns

TypeDescription
stringRecovered Luau source.

Notes

Runs the local decompiler helper and checks that its output compiles. Missing bytecode and helper failures raise errors. Recovered names and control flow may differ from the original source.

Example

Luau
local Result = decompile(function() return "hello" end)
print(Result)