Hey, I'm making a game and I want to know how to check if they have the gamepass to activate a function. Does it require an if statement? Is this suppose to be in a local script?
✓ ANSWER ACCEPTED
How to check if a player has a gamepass? (SOLVED)
1 answer
✓ Accepted answer
Here is a place to help you http://wiki.roblox.com/index.php?title=Game_Pass
here's some code of the wiki and a little edited by me
local passId = 0000000 -- change this to your game pass ID.
function isAuthenticated(player) -- checks to see if the player owns your pass
return game:GetService("GamePassService"):PlayerHasPass(player, passId) -- this method will check to see if player has the pass from the passId
end
function Start(plr)
print(plr.Name .. " has bought the game pass with id " .. passId)
end
game.Players.PlayerAdded:connect(function(plr)
if isAuthenticated(plr) then -- checks to see if player is authenticaded
Start(plr) -- activate function
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
http://wiki.roblox.com/index.php?title=Game_Passes_%E2%80%93_Abilities_and_Bonuses
This wouldn't work anymore, PlayerHasPass is depreciated, easy fix though, just change it to the MarketplaceService and put UserOwnsGamePassAsync