Post
by Jor'Mox » Sun Aug 19, 2018 12:05 am
So, it depends on how you created the table. Table values are either indexed or keyed, and which one you used is going to influence how you can access that data. If, in creating the individual entries in your larger puppet table, you did something like this: table.insert(puppets,{id = ###}), then you could use puppets[1].id to get the id for the first entry in the table, puppets[2].id to get the second, etc. You could also get the same data like this: puppets[1]["id"], which is useful if the key you used contains a character that isn't a letter, a number, or an underscore. If instead you did it like this: table.insert(puppets,{###}), then you would need to know the position of the ID within the table, and use that index. If it were the first entry, you would do that like this: puppets[1][1] to get the first id, and puppets[2][1] to get the second.