Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to check if a player has a gamepass?

Asked by 4 years ago

I have this script that is supposed to check if player has a game pass, but it doesn't work. Any ideas why?

game.Players.PlayerAdded:connect(function(plr)
    wait(3)
    if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId, 7033725) then
        print(plr.Name.." has VIP")
    end
end)
0
this should work, make sure the script is enabled and that u dont have a loop in the same script Gameplayer365247v2 1055 — 4y

2 answers

Log in to vote
1
Answered by
Joshument 110
4 years ago

That is correct, or it may not be, try a few of these things and tell me if they work:

  1. Invert User ID and Gamepass ID
  2. Make sure there is no loop occurring before this function
  3. Make sure API access is enabled in roblox studio or else this may not work
  4. Make sure that you have the right gamepass there
0
Looks like I forgot to enable API access, thanks! JexaButterscotch 73 — 4y
Ad
Log in to vote
0
Answered by
Drakyd 1
4 years ago

https://developer.roblox.com/en-us/api-reference/function/GamePassService/PlayerHasPass check this out

1
That's deprecated and only works with old game passes. royaltoe 5144 — 4y

Answer this question