if toyData.Materials == 1 then
if toyData.Wool > 0 then
toyFrame.First.Quantity.Text = toyData.Wool
end
if toyData.Wood > 0 then
toyFrame.First.Quantity.Text = toyData.Wood
end
if toyData.Metal > 0 then
toyFrame.First.Quantity.Text = toyData.Metal
end
if toyData.Fleece > 0 then
toyFrame.First.Quantity.Text = toyData.Fleece
end
end
if toyData.Materials == 2 then
if toyData.Wood > 0 then
toyFrame.Second.Quantity.Text = toyData.Wood
end
if toyData.Metal > 0 then
toyFrame.Second.Quantity.Text = toyData.Metal
end
if toyData.Fleece > 0 then
toyFrame.Second.Quantity.Text = toyData.Fleece
end
end
if toyData.Materials == 3 then
if toyData.Metal > 0 then
toyFrame.Third.Quantity.Text = toyData.Metal
end
if toyData.Fleece > 0 then
toyFrame.Third.Quantity.Text = toyData.Fleece
end
end
ModuleScript
toys.Data = {
['Teddy Bear'] = {
['Level'] = 1,
['Materials'] = 1,
['Wool'] = 2,
['Wood'] = 0,
['Metal'] = 0,
['Fleece'] = 0
},
['Ball'] = {
['Level'] = 1,
['Materials'] = 1,
['Wool'] = 3,
['Wood'] = 0,
['Metal'] = 0,
['Fleece'] = 0
},
['Yo-Yo'] = {
['Level'] = 2,
['Materials'] = 2,
['Wool'] = 1,
['Wood'] = 2,
['Metal'] = 0,
['Fleece'] = 0
},
['Slinky'] = {
['Level'] = 3,
['Materials'] = 1,
['Wool'] = 0,
['Wood'] = 3,
['Metal'] = 0,
['Fleece'] = 0
},
['Drum Set'] = {
['Level'] = 5,
['Materials'] = 2,
['Wool'] = 3,
['Wood'] = 5,
['Metal'] = 0,
['Fleece'] = 0
}
}
The Materials number inside the module script is to determine how many materials each toy would need (so Teddy bear only uses the wool material, while the yoyo uses wool and wood, so 2 materials. The problem I am having is I have 3 boxes. In each box it would show what materials would be needed to make the item. So if its only 1 material, then the first box would be for that one particular material. The problem arises when it’s 2 or more materials. I don’t know how to get it to fill in the first box with the first material then move onto the second material