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

How do I get if the sale has completed?

I have been using this in game to prompt the purchase but what I would like to do is fire a GUI to open if the sale completed.

local shirtId = 0000000000

script.Parent.ClickDetector.MouseClick:connect(function(player)
game:GetService("MarketplaceService"):PromptPurchase(player, shirtId)
end)

1 answer

✓ Accepted answer

You can use MarketplaceService.PromptPurchaseFinished to know when the player purchases a shirt that you prompted in-game.

local shirtId = 0000000000

script.Parent.ClickDetector.MouseClick:connect(function(player)
    local MarketplaceService = game:GetService("MarketplaceService")
    MarketplaceService:PromptPurchase(player, shirtId)
    MarketplaceService.PromptPurchaseFinished:Connect(function(buyer,assetId,isPurchased) 
	    if assetId == shirtId and buyer.UserId == player.UserId then
		    -- Do something
	    end
	end)
end)

2 comments

1

Thank you very much.

0

No problem!

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