Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Prompting multiple assets not working?

What I am trying to do here is make a shopping cart, where multiple items can be purchased on selection. The problem is, it only prompts the purchase for the first item in the cart. I had tried a repeat wait() until but I got the same problem. Here is the script I used (local 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
		end
	end
end)

Side-note: I am trying to avoid ProcessReceipt because this is supposed to be client-sided. If I have no other choice, please let me know.

Thank you in advance!

1 answer

✓ Accepted answer

MarketPlaceService.PromptPurchaseFinished is an event, not a property

to wait for it to fire you have to do market.PromptPurchaseFinished:Wait()

This discussion is preserved as it was. New answers, comments, and votes are closed.