I’m not sure subtable is the 100% correct terminology but it fits logically, anyways I don’t usually work with tables and decided to incorporate some. However I can’t for the life of me figure out how to iterate through my subtables.
My Code looks something like this:
local table = {
{tip = blah,blah,blah}
{tip = blah,hmm,blah}
{tip = hmm,blah,blah}
}
local tip = math.random(1,3)
--I would like to iterate through the randomly selected "tip"
--I tried the following
for i, v in ipairs(table[tip]) do
print(v)
end
--Which did not work
I looked it up and only found people wanting to iterate through everything not a specific entry in the table, any and all help is appreciated ![]()