Decompiling scripts
Turn compiled LocalScripts and ModuleScripts back into readable Luau with decompile().
Roblox sends client-side scripts to your PC as compiled Luau bytecode. decompile turns that bytecode back into source you can read, search and learn from.
One script
Lynx has no decompiler view: decompile is a function your scripts call. It returns the source as a string. Write it to the workspace, then open the file from Files in the sidebar.
Many scripts
A loop decompiles a whole folder of the game into a folder of your workspace.
What to expect
decompile yields while it works, then returns a string:
- On success, the reconstructed Luau source.
- On failure, a Luau comment that says why, for example that the bytecode is empty. It doesn't raise an error, so check the result before you trust it.
- Bytecode works too. Pass the string from
getscriptbytecodeinstead of a script.
Bytecode keeps the structure of a program, but not everything the author wrote. Comments and type annotations are never recovered, because they don't exist in bytecode.
What can't be decompiled
- Server scripts. A
Scriptthat runs on the server never reaches your PC. There's no bytecode to decompile. - Anything that stays on the server. Scripts in
ServerScriptServiceandServerStorageare never replicated to clients. - Functions.
decompiletakes a script or bytecode. Passing a function raises an error.
A whole place
saveinstance() saves the place you're in as a Roblox place file and decompiles its scripts on the way. Pass { Decompile = false } to skip the decompiling and save faster.
Written for Lynx 0.0.0
Something unclear? Tell us on Discord