How to iterate through nested Lua table with LUA script
<p>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.</p>

<p>print(itemGroups.groups[1][2])</p>

<p>print(itemGroups.groups.group[1])</p>

<pre><code>itemGroups = {
        {
        groups = {
            {group = "item1", chance = 10},
            {group = "item2", chance = 20},
            {group = "item3", chance = 30},
        },
        itemChance = 50
        }
}
</code></pre>