View Single Post
10-21-15, 01:43 PM   #13
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 341
Originally Posted by saxitoxin View Post
snip
Ok, you messed up with playerFaction thingy... I'll rewrite code the way it should be and post it here a bit later.

Thing is you are dealing with a table, you have to create it step by step, a table within a table within a table.

It normally initialize tables this way:
Lua Code:
  1. local table1 = {
  2.     table2 = {
  3.         table3 = {
  4.         -- other tables
  5.         }
  6.     }
  7. }

or this way:
Lua Code:
  1. local table1 = {}
  2. table1.table2 = {}
  3. table1.table2.table3 = {}

You can't skip a step and do it like so:
Lua Code:
  1. local table1 = {}
  2. table1.table2.table3 = {}

You'll get an error, cuz table2 doesn't exist, there's no such index. That's what you've done wrong.
__________________
  Reply With Quote