I have a code, for prompting a player to buy a gamepass (NOT!!! a Developer Product) by using a service called GamepassService and then function PromptGamePassPurchase(player, id), afterward checking if the player owns that gamepass on join.
The thing is, with developer products I can do something IF THE PURCHASE WAS SUCCESSFUL, how can I do it with GamepassService... Other words, CAN I?

3 comments
(Prompt Purchase is a LocalScript in a gui, check if player owns gamepass is another LocalScript)
there is an event of MarketplaceService called PromptGamePassPurchasedFinished that fires when someone purchases a game pass. https://developer.roblox.com/api-reference/event/MarketplaceService/PromptGamePassPurchaseFinished
if the wasPurchased parameter is false then a the player canceled the prompt, and if its true then they bought the gamepass