Aliases
setconstant
Arguments
function | number
required
The function to inspect, or a positive stack level identifying a caller.
number
required
A 1-based slot index.
any
required
The replacement constant; its type must match the existing slot.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Changes a constant while preserving its native type.
debug.setconstant(target: function | number, index: number, value: any): ()
setconstantlocal function sample() return "docs-before" end
for index, value in pairs(debug.getconstants(sample)) do
if value == "docs-before" then debug.setconstant(sample, index, "docs-after") end
end
print(sample())
