Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

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

Asked by 10 days ago

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
0
Is "v.Gamepass.Value" The Game Pass Id? if it is , then this script should work. What seems to be the problem here? Tizzel40 225 — 10d

1 answer

Log in to vote
0
Answered by
Tizzel40 225 Moderation Voter
10 days ago

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

Ad

Answer this question