Jump to content

string to variable


kuwalda

Recommended Posts

I have simple question - if I have string value, can I use it as variable?

  
example = { } 
example[settings][1] = "thePlayer" 
example[settings][2] = "root" 
example[settings][3] = "functionX" 
  
if isElementVisibleTo ( marker, example[settings][1] ) then 
  

Link to comment

It does not because that's not how it works. loadstring takes a string with Lua code, and all it returns is a function whose body is the code you passed.

As for your issue, I'd rather do it manually than fill your code with ugly hacks.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...