debug. setstack Synchronous
setstack
Write one register in a visible Luau stack frame. It is a low-level tool for changing an active call’s state; inspect the slot first and restore it if you only need a temporary probe.
Luau
debug.setstack(level: number, index: number, value: any) -> ()Parameters
| Parameter | Type | Description |
|---|---|---|
level | number | Visible stack level to modify. |
index | number | One-based register slot. |
value | any | Value written into the slot. |
Returns
()No value.
Usage notes
The same numeric slot can mean something different in another call frame.
Example
Luau
local function inspect()
local old = debug.getstack(1, 1)
debug.setstack(1, 1, old) -- A harmless round trip of one slot
end
inspect()