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
| Parameter | Type | Description |
|---|---|---|
target | LuaSourceContainer | Script container to inspect. |
Example
local target = game:FindFirstChildWhichIsA("LocalScript", true)
if target then
local bytecode = getscriptbytecode(target)
print(bytecode and #bytecode)
endExample output
3214Prints the bytecode chunk's byte length; the exact number depends on the script that FindFirstChildWhichIsA picked.
Aliases: dumpstring.
