decompile Asynchronous
bytecode_to_lua
Translate Luau bytecode or a script Instance into readable source-like text. Use it to inspect code when the original source is unavailable; the output is a reconstruction, not the author’s exact file.
Luau
decompile(input: string | ScriptInstance, options: DecompileOptions?) -> stringParameters
| Parameter | Type | Description |
|---|---|---|
input | string | ScriptInstance | A Luau bytecode string or script Instance with readable stored bytecode. |
options | DecompileOptions? | Optional target and mode fields. target is luau or lua51; mode is decompile or disasm. |
Argument fields
Luau
DecompileOptions = {target: ("luau" | "lua51")?, mode: ("decompile" | "disasm")?}Returns
stringText produced by the decompiler or disassembler.
Usage notes
The call can yield while native work completes. Invalid bytecode, unsupported options, or an unavailable script body raises an error.
Example
Luau
local candidate = getscripts()[1]
if candidate then
local ok, source = pcall(decompile, candidate, { target = "luau" })
print(ok and source:sub(1, 200) or "Decompilation unavailable")
end