Volt

getscriptbytecode

Gets the compiled bytecode of a script.

Syntax

getscriptbytecode(script: LocalScript | ModuleScript) -> string

Parameters

ParameterTypeDescription
scriptLocalScript or ModuleScriptThe script

Returns

TypeDescription
stringThe compiled Luau bytecode

Description

getscriptbytecode extracts the compiled bytecode from a script. This can be used for analysis or decompilation.

Example

local scripts = getrunningscripts()
if #scripts > 0 then
    local bytecode = getscriptbytecode(scripts[1])
    print("Bytecode length:", #bytecode)
    
    -- Save to file for analysis
    writefile("script_bytecode.bin", bytecode)
end

Notes

  • Bytecode is in compiled Luau format
  • Can be decompiled with appropriate tools
  • Useful for script analysis and research

Aliases

  • dumpstring

On this page