Skip to content
Saiko

getscriptbytecode

Returns the compiled Luau bytecode behind a script.

Signature

luau
getscriptbytecode(script: BaseScript): string

Parameters

scriptLocalScript | ModuleScript

The script to dump.

Returns

string

Example

luau
local script = game.Players.LocalPlayer.PlayerScripts:FindFirstChildOfClass("LocalScript")
local bytecode = getscriptbytecode(script)
print(#bytecode, "bytes")