I\'m trying to find a way to share global variables of a specific Lua script(test.lua
in the example) between different Lua states.
Here\'s my simple exampl
Two distinct lua_State
s are completely and totally independent. One cannot directly affect anything that happens in another. You can expose some C code to one that allows it to modify the other, or they could both access some external resource (a file, for example) that allows them to share data.
But outside of things like this, no, they cannot interact.
The preferred method for this is to not make them separate lua_State
s.