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

how do I check if a player has bought a pass?

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

1 comment

0

Is "v.Gamepass.Value" The Game Pass Id? if it is , then this script should work. What seems to be the problem here?

1 answer

If you want to know whether or no someone bough a pass after the prompt purchase screen was closed you can use the PromptGamePassPurchaseFinished() Event

It has 3 Arguments

  • The Player
  • The GamePass Id
  • And A 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

:) !

--T40

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