Syntax
setstack(level: number | integer, index: number | integer, value: any)Aliases
debug.setstackArguments
| Name | Type | Description |
|---|---|---|
level | number | integer | One-based stack level to inspect or update. |
index | number | integer | One-based index inside constants, protos, upvalues, or stack slots. |
value | any | New value to write. |
Description
Replaces a stack slot value at the selected stack level.
Call it with 3 parameter(s): level, index, value. The argument table explains which values are required and which ones only refine the behavior.
It does not return data. Treat the call as an action and handle errors around the call site when needed.
Example
Example call with placeholder values.
setstack(1, 1, nil)