getfunctionbytecode
Returns the bytecode for a Luau closure.
Syntax
getfunctionbytecode(func: function) -> stringParameters
| Parameter | Type | Description |
|---|---|---|
func | function | Luau closure to read |
Returns
| Type | Description |
|---|---|
string | Binary Luau bytecode for the closure |
Example
local function add(a, b)
return a + b
end
local bytecode = getfunctionbytecode(add)
print(type(bytecode), #bytecode > 0) -- string, trueNotes
- C closures are rejected
Related Functions
getscriptbytecode- Get the source payload stored for a scriptgetfunctionhash- Hash a Luau closure's instructions and constants