✓ Accepted answer
I'm going to start of by saying that isn't "calling" a list; you call a function, you create a list.
Anyway, of course it's possible! You can store data inside a dictionary, and that data can take almost any form. You could even create a dictionary inside a dictionary.
The way you referenced it would definitely work! Except you are using a dictionary, so the line local idtable = table[1] doesn't work since there is no key 1. The keys are Thing and OtherThing.
If you think about it, you set idtable to be defined as the first item in the dictionary (let's imagine you fixed the [1] error). That means saying arraynumfromtab = idtable[1] is perfectly valid. It's equivalent to saying this:
local idtable = {1, 0}
local arraynumfromtab = idtable[1]
local otherarraynumfromtab = idtable[2]
And this definitely works!
You can also use a shortcut of indexing those elements:
local table = {
["Thing"] = {1,0},
["OtherThing"] = {2,0},
}
local arraynumfromtab = table["Thing"][1]
local otherarraynumfromtab = table["Thing"][2]
Obviously the way mentioned previously would be better for this case, but this shortcut is good to know.
I hope this helps! :)
2 comments
thanks gamer
If @chomboghai answered your question, please make sure to accept his or her answer.