I am using a Lua script to parse data from a Lua file in this structure. I'm having difficulty pulling all of "group = " values because of the way it's nested. I've tried many variations of the following print command to be able to even get just one value but cannot seem to find the correct syntax. I need to be able to loop through all group = "items" and print them out.
print(itemGroups.groups[1][2])
print(itemGroups.groups.group[1])
itemGroups = {
{
groups = {
{group = "item1", chance = 10},
{group = "item2", chance = 20},
{group = "item3", chance = 30},
},
itemChance = 50
}
}