getscriptbytecode Synchronous

  • dumpstring

Read the stored Luau bytecode of a script Instance. Use it for offline inspection or as input to decompile when the bytecode is available.

Syntax
Luau
getscriptbytecode(script: ScriptInstance) -> string?

Parameters

Function parameters
ParameterTypeDescription
scriptScriptInstanceScript Instance to inspect.

Returns

string?

A byte string, or nil when this script’s stored bytecode cannot be read.

Usage notes

The result is binary data. Its availability depends on the script kind and current runtime state.

Example

Example
Luau
local candidate = getscripts()[1]
if candidate then
    local bytes = getscriptbytecode(candidate)
    print(bytes and ("Bytecode bytes: " .. #bytes) or "Bytecode unavailable")
end
Kawaii documentation