I have a (Dictionary) like this (Basically this module is for the lucky box)
local Inventory = {
["Starter"] = {
["Cost"] = 200,
["Sword"] = {
["Ice"] = {"Ice", 35}, --35 is the rarity
["Fire"] = {"Fire", 35},
["Water"] = {"Water", 20},
["Soil"] = {"Soil", 10},
}
}
}
return Inventory
and i want to make a Image GUI for the ice,fire,water, and soil but why this script only Clone 1 Image Template instead of 4???
local ShopData = require(script.ModuleScript)
template.MouseButton1Click:Connect(function()
for i,v in pairs(ShopData["Starter"]["Sword"]) do
local CloneTemp = script.Template:Clone()
CloneTemp.Parent = script.Parent.ScrollingFrame
CloneTemp.Name = v[1]
CloneTemp.SwordName.Text = v[1]
CloneTemp.Percent.Text = v[2] .."%"
end
end)
EDIT: this script works fine guys, my mistakes i forgot that i add this after the for i,v instead of after click
for a,x in pairs (Detail.Info.List:GetChildren()) do --Clear the previous layout
if x.Name ~= "UIGridLayout" then
x:Destroy()
x = nil
end
end

4 comments
Is the template supposed to be different for each one? I don't really understand what you need from this.
yess supposed to be different, But the script only clone 1 time instead of 4. The script need to clone the template for the ice, water, fire, soil
I have a lucky-block like crate that drops down. Its not very efficient, But it works. You will have to modify it to make it work in your game. (Because im so lazy duh) Just respond to this comment and i will give a answer containing the script. Just a suggestion.
My lucky block works fine, the problem is the display (a gui that contain the 'name' of that sword). That script only clone 1 times and not 4 times