I found a way to turn string to code:
function RUN(_x)
local _test = load("return " .. _x)
return _test()
end
MyVar = 5
RUN("trace('WORK! '..MyVar)")
And now I can make my own Language in Tic-80 with "switch", without "then" and with Pause by dialogue and menu for dialogue scripting,and game scripts by string with line parser and [=[ ]=] brackets in Lua for long strings: local MyLongText = [=[ ... ]=]
But I can't find how to make variable initializations/changes! Because these lines have an error:
RUN("MyVar = 1")
or
RUN("MyVar = MyVar + 1")
Is there a way to change variables by string in Lua?