Make a shop in price order

I dont really know who do this at all. This is my script:

wait(5)

for i,v in pairs(game.ReplicatedStorage.Abilities:GetChildren()) do
	local c = script.Cell:Clone()
	c.Visible = true
	c.Parent = script.Parent.MainFrame
	c.Image.Image = v.Image.Image
	c.Type.Text = v.UI_Name.Value
	c.Name = v.Name
	c:FindFirstChild("Level").Text = "level "..tostring(v.Level.Value).."	required"
end

Btw every cell will go into a scrolling a frame that has a ui grid layout

look at this:

you want to change each “cell”'s layout order to the price, and it will sort it correctly.

it would look something like:

c.LayoutOrder = some sort of cost
2 Likes

thanks man, that works perfectly and is very simple!

1 Like