Jump to content

Problem with tables


Recommended Posts

I think it's the way you're declaring the array indicies. Try it like this instead:

  
local classes = { 
    civilians       = { 
        title       = 'Street people', 
        team        = 'civilian', 
        message = 'Living people on the streets,\nThey do just normal!' 
    }, 
    ... 
  

You can then access like:

  
local p = classes["civilians"] 
  

OR

  
local p = classes.civilians 
  

Link to comment

I'm going to have to disagree, i've recently written a script and it was a toss up between xml or lua tables, and it turns out that tables were by far the best to use. Once you realise the power of tables XML becomes as insignificant as Brophy's sexual advances.

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...