AcediaDocumentation

getscriptbytecode

Reads decoded bytecode from a script container.

Returns nil when bytecode is unavailable or cannot be decoded. The returned string is binary data, not readable Luau source.

getscriptbytecode(target: LuaSourceContainer): string?

Parameters

ParameterTypeDescription
targetLuaSourceContainerScript container to inspect.

Example

local target = game:FindFirstChildWhichIsA("LocalScript", true)
if target then
    local bytecode = getscriptbytecode(target)
    print(bytecode and #bytecode)
end

Example output

3214

Prints the bytecode chunk's byte length; the exact number depends on the script that FindFirstChildWhichIsA picked.

Aliases: dumpstring.

On this page