ive been trying to figure this out for over a hour and I can't. Im trying to do something if the player actually buys the gamepass. I would prefer to do it in this if statement because this if statement is in a touched event and the only way to get the gamepass ID is to get it from the touched event
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,v.Gamepass.Value) then print("player already has pass") else game:GetService('MarketplaceService'):PromptGamePassPurchase(player,v.Gamepass.Value) print("bought") end
If you want to know whether or no someone bough a pass after the prompt purchase screen was closed you can use the
It has 3 Arguments
bool (true or false)that will say weather the player has bought the pass or not .
here is a link right here for more information ! :
you can use this this link : https://developer.roblox.com/en-us/api-reference/event/MarketplaceService/PromptGamePassPurchaseFinished