Skip to content
Scripts & runtimeOverview

getscriptbytecode

Represents access to a script's bytecode representation.

Aliasesdumpstring

Details#

Returns the available compiled bytecode string of a script object. Bytecode is binary data, not source text. A new or unavailable script may have no retrievable bytecode or raise an error.

Examples#

Example

Luau
local ownScript = Instance.new("LocalScript")
local ok, bytes = pcall(getscriptbytecode, ownScript)
if ok and type(bytes) == "string" then print(#bytes) else print(ok, bytes) end
ownScript:Destroy()