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.
Luau
getscriptbytecode(script: ScriptInstance) -> string?Parameters
| Parameter | Type | Description |
|---|---|---|
script | ScriptInstance | Script 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
Luau
local candidate = getscripts()[1]
if candidate then
local bytes = getscriptbytecode(candidate)
print(bytes and ("Bytecode bytes: " .. #bytes) or "Bytecode unavailable")
end