Hello! Recently, I have been writing a script where you can put items into a "shopping cart" and then press checkout, where it will do a prompt purchase for all the items. The main problem is that it only seems to be prompting one asset. When I do prints, it says I bought all three (assuming I put all 3 in the cart) even though I could only view one prompt. Is there any way I can fix this? Here is my script:

local market = game:GetService("MarketplaceService")

script.Parent.MouseButton1Click:Connect(function()
	for a, b in pairs(script.Parent.Parent.Items:GetDescendants()) do
		if b:IsA("NumberValue") and b.Name == "AssetId" then
			market:PromptPurchase(game.Players.LocalPlayer, b.Value)
			repeat wait() until market.PromptPurchaseFinished:Wait()
		end
	end
end)

Thank you in advance!