1 | local presentMesh = { 66887781 = { 189748284 } , 1237207 } |
There is an example of what I want, but it doesn't work. I want the "66887781" to equal multiple values, but still be a table. Help, thanks!
You could essentially keep as many tables as you want in a table.
Here's an example:
1 | local menu = { |
2 | [ 1 ] = { "Burger" , 3.50 } , |
3 | [ 2 ] = { "Fries" , 2 } , |
4 | [ 3 ] = { "Soda" , 1.99 } |
5 | } |
And if you wanted to store multiple tables inside each other, you could do this:
1 | local menu = { |
2 | [ "Meals" ] = { |
3 | [ "Number 1" ] = { "Cheeseburger" , "Fries" , "Drink" , 8 } , |
4 | [ "Number 7" ] = { "Hamburger" , "Fries" , "Drink" , 7 } , |
5 | [ "Number 18" ] = { "Veggie" , "Fries" , "Drink" , 6.50 } |
6 | } |
7 | } |
Hope this helped.
Tables are a what they sound like, a list of values or a table of values. Tables can hold any piece of information, including other tables.
If what your saying is what i think your saying, you would use the following;
1 | table 1 = { } |
Table 1 is your first table. You can store anything inside of it.
1 | table 1 = { table 2 = { "Value 1" , "Value2" } } |
Table 1, contains a table called table 2. Table 2 contains 2 values, value 1 and value 2
Lets say value 1 and value 2 equal, 1 and 2.
table1 = {table2 = { 1 , 2 } }
You can edit the value of 1 and 2 inside of table two by doing the following;
Example1;
1 | table 1. table 2 [ 1 ] = 5 |
Example2;
1 | table 1. Table [ 2 ] = 8 |
another example is;
1 | Orange = { Apple = { "Mango" , "Bananna" } } ------------ Very creative ;) lol |
Again, you can edit the contents of apple by doing the following;
1 | Orange.Apple [ 1 ] = "SomeOtherFruit" |
The [1] is the place value of the item within the table, say there are 5 items, and you want to edit the 4th, you would use [4]
Note; From my experience, i may be wrong, for example, table1 = { table2={} }, if you request the number of items within table1, it would return 0 or nil.
In this case,
1 | table 1 = { table 2 = { } , "Example" } , |
it will return 1, a table inside of a table is not counted, but the contents of the 2nd table will be counted for the number of items requested for the seccond table.
One last thing;
1 | Orange = { Apple = { "Banana" , "Mango" } } |
If you want to edit the table, say change Apple to another table, aka the contents of apple you can do the following; Table2 = {"Nothing","Fruits are gross"}
Orange.Apple = Table2
It will return like so;
1 | Orange = { Apple = { "Nothing" , "Fruits are gross" } } |
Sorry for hogging your time, but i'd just thought i'd give you my knowlage on how tables work as it might help out in the future.