This event fires when a purchase dialogue of a game pass is closed. This fires right as the dialogue closes when the player presses “Cancel” at the prompt, or “OK” at the success/error message.
For developer product purchase prompts, connect to
MarketplaceService/PromptProductPurchaseFinished. In order to
process such purchases you need to set the
MarketplaceService/ProcessReceipt|ProcessReceiptcallback in a
For affiliate gear sales or other assets, use
The Player object for whom the prompt was shown
The ID number of the game pass shown in the prompt (not to be confused with an asset ID)
Whether the item was successfully purchased (false for errors and cancellations)
Handling Gamepass Purchase Finished
Below is a screenshot of a game pass purchase prompt. The function in the code sample runs immediately after the player presses “Cancel” or after the player buys the game pass then presses “OK”. Should there be an issue with the purchase, the event also fires.
local MarketplaceService = game:GetService("MarketplaceService") local function gamepassPurchaseFinished(...) -- Print all the details of the prompt, for example: -- PromptGamePassPurchaseFinished PlayerName 123456 false print("PromptGamePassPurchaseFinished", ...) end MarketplaceService.PromptGamePassPurchaseFinished:Connect(gamepassPurchaseFinished)