getscriptbytecode

Reads a script's available bytecode.

Syntax

Signature
getscriptbytecode(Script: Instance) -> string

Aliases

  • dumpstring

Parameters

ParameterTypeDescription
ScriptInstanceScript table with a nonempty raw _id.

Returns

TypeDescription
stringBinary Luau bytecode.

Notes

If no cached load is available, searches the selected VM for a matching live root prototype and serializes it. Raises an error when neither source is available.

Example

Luau
local Script = getscripts()[1]
assert(Script, "No captured script available")
local Result = getscriptbytecode(Script)
print(Result)