setlocal

setlocal (LEVEL, LOCAL, VALUE)

Assigns VALUEto the local variablewith index LOCAL of the function at level LEVEL of the stack.Returns nil if LOCAL is out of range, and raises an error when called with a LEVEL out of range.