currently I am trying to export and re-import some variables in LUA.
Imagine a table AllGlobals. The table contains all global variables used in my script, while key contains the variable name and value - surprise - contains the variable value.
What my script should do now is a reassignment of the variables. I started thinking about the following solution, which obviously isn't working:
1 function InsertGlobals()
2 for key,value in pairs(AllGlobals) do
3 key = value
4 end
5 end
Well: Does anybody know a solution for assigning the value in line 3 to the variable name contained in key, not inserting it into the variable key itself?