Plouf explained correctly, but might be easier to understand it this way.
The point here is that you can't just make Table = {} and then use something like Table.x{1].sub[2], because you have not made any tables beyond "table", as in Table.x doesn't exist yet, you have to first do it using Table.x = {}
However, if you start by directly doing Table.x = {}, without doing table = {} first, then it would fail again, since Table wouldn't exist yet.
To show the easier-to-understand way how your case would work is to do:
Code: Select all
Player = {}
Player[1] = {}
Player[1].Row = {}
Player[1].Row[1] = {x = 100, y=199}
Now you can use:
Code: Select all
Player[1].Row[1].x = 200
Player[1].Row[1].y = 300
But do realize that Player[2] or player[3] doesn't exist yet, neither do Player[1].Row[2], or Player[1].Row[3] exist yet, you have to make them into existence too, which you could do, for example, in the following way (easier to understand way perhaps)
Code: Select all
Player = {}
for p = 1 to 4
Player[p] = {}
Player[p].Row = {}
for r = 1 to 10
Player[p].Row[r] = {X = 1, Y = 2}
next
next
Now you would have players 1-4, and each of them contains rows 1-10, with X and Y inside that table