debug.setlocal
Example
Prints the local variables, sets them, then prints the variables again.
Output: Getting the locals now!
1 = var1
2 = Luke, I am not your father.
1 = var2
2 = PMFPMF
Setting the locals now!
var1
var2
nil
Here are the locals after being set!
1 = var1
2 = I'm actually your mother.
1 = var2
2 = Chemo-chi