So i’ve made a Rock table that will go through a different variety of rocks and include it’s stats and loot table. However I do not know how I will get everything including the loot table from the table. Any help will be appreciated!
Table:
local module = {}
module.Rocks = {
["Stone"] = { --Rock Name
SpawnChance = 50, --The Chance of the rock spawning
xp = math.random(3,7), --Amount of Xp it can drop
{Name = "Stone", Weight = 100, Amount = math.random(2,5)}, --Loot Table
},
["Coal Ore"] = { --Rock Name
SpawnChance = 50, --The Chance of the rock spawning
xp = math.random(3,7), --Amount of Xp it can drop
Loot = {
{Name = "Copper", Weight = 100, Amount = math.random(1,5)}, --Loot Table
},
},
["Geode"] = { --Rock Name
SpawnChance = 50, --The Chance of the rock spawning
xp = math.random(10,20), --Amount of Xp it can drop
Loot = {--Loot Table
{Name = "Amethyst", Weight = 12.5, Amount = math.random(1,4)},
{Name = "Topaz", Weight = 12.5, Amount = math.random(1,4)},
{Name = "Sapphire", Weight = 12.5, Amount = math.random(1,3)},
{Name = "Amber", Weight = 12.5, Amount = math.random(1,3)},
{Name = "Ruby", Weight = 12.5, Amount = math.random(1,3)},
{Name = "Diamond", Weight = 12.5, Amount = math.random(1,3)},
{Name = "Emerald", Weight = 12.5, Amount = math.random(1,3)},
{Name = "Onyx", Weight = 12.5, Amount = math.random(1,2)},
},
},