Hi! I'm making a shop GUI. I want something to happen when a gamepass purchase is either canceled, or completed. Is there any way to detect this?
✓ ANSWER ACCEPTED
Can I detect when a purchase is completed?
1 answer
✓ Accepted answer
###You would be using the PromptGamePassPurchasedFinished event of the MarketplaceService. It should be handled on the server.
local MarketplaceService = game:GetService("MarketplaceService")
local ID = 0000000009 -- put your id here
local onFinish
onFinish = function(player, passId, isPurchased)
if passId == ID then -- check if id
if isPurchased then -- if they purchased it, not click cancel
-- code
else
print("Not bought")
end
end
end
MarketplaceService.PromptGamePassPurchaseFinished:Connect(onFinish)
1 comment
0
Oh, I completely forgot about that. Thanks!
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Look under the events in MarketplaceService.