lua - How to check the value of a boolean (set by user) with a variable string? -
the user sets boolean true or false.
that (exemple)
elementnameone = true elementnametwo = false elementnamethree = true etc.
now have string loaded file. string called name can have values nameone, nametwo, namethree, etc. of them @ time. able this
if element .. name == true except don't know how properly.
i've tried do
if not not ("element" .. name) but not work.
can ?
thanks
try this:
if _g["element" .. name] == true -- end note work if variables set user (elementnameone, .. etc.) globals.
Comments
Post a Comment