debug.getupvalue
Description
We advise against using this. It may be changed or removed in a future update.
Used for getting variable values in an index from the passed function. This does nothing for C functions.
Arguments
2 number index
The index in the upvalue array. The max number of entries can be found in debug.getinfo's "nups" key.
Returns
1 string
Name of the upvalue. Will be nil if the index was out of range (< 1 or > debug.getinfo.nups), or the function was defined in C.
Example
Prints the upvalues of some local functions.
Output: DoSomethingWithFoo:
foo = 5
DoSomethingWithFooAndBar:
bar = hello
foo = 5
DoSomethingWithBarAndTest:
bar = hello
test:
1 = table
2 = true
3 = variable
Garry's Mod
Rust
Steamworks
Wiki Help