Okay so I created a script that gets my Developer Products and copies the data into a frame so I can keep adding Dev products and the shop will update without me really doing anything. So the code to create these presets is this:
local scroller = script.Parent.scroller local devProducts = game:GetService("MarketplaceService") local products = devProducts:GetDeveloperProductsAsync():GetCurrentPage() local market = game:GetService('MarketplaceService') for _,v in pairs(products) do local cl = script.B1:Clone() cl.Parent = script.Parent.scroller cl.icon.Image = "rbxassetid://"..v.IconImageAssetId cl.Title.Text = v.Name cl.Name = v.Name cl.buy.MouseButton1Down:Connect(function() market:PromptProductPurchase(game.Players.LocalPlayer, v.ProductId) end) end
The only problem is it's not in order of the 'gem amount' so it goes like 1000, 250, 750, 10000 any help with this?
The table layout is like this - local products = { ["random name roblox makes"] = { ["Name"] = "product1", ["PriceInRobux" = 100 } }
(that's not exactly it but I assume you understand.)
Basically I just want the frames to be ordered in Robux Price (which can be easily gained with v.PriceInRobux, it returns a string)
SOLVED (EDIT) This was solved by putting each dictionary into one table, and then using a custom table.sort function that checks the dictionary value PriceInRobux and then sorts them using that value. If anyone else has this problem here is the sorting function
Change PriceInRobux to the value you want to sort your dictionaries by
table.sort(sortedTables, function(a, b) return tonumber(a.PriceInRobux) < tonumber(b.PriceInRobux) end)