@Dikkesnoek usually in such cases tables are used, like
--you have a table with variableslocal vars ={}--you retrieve a string valuelocal l ="level01"--you use string value as key and place something in it
vars[l]=10
Ok thanks. I come to this because the level indexes will be generated and added to the level string like "level" + "01", "level" + "02" and stored in the JSON file. Later on I need to use these names as variables.
Comments
Marc
though I would advice against this very strongly, you can also set these are global variables and use them as
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
and added to the level string like "level" + "01", "level" + "02" and
stored in the JSON file. Later on I need to use these names as variables.
Regards,
Marc