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

How can check if a player has brought a Game Pass?

I have a chat script which checks if a player has a certain name and all that but I can't quite figure how I can get it to check if a player has a game pass that they have brought?

i.e

local Pass = Gamepass id
if Player has Pass then
	-- Stuff I already have wrote --
end

1 answer

✓ Accepted answer

You would use the PlayerHasPass method which is a member of GamePassService.

Example

local id=0 --gamepass id
local plr=game:GetService("Players").Player1 --edit player1 to the player you are trying to index
local gService = game:GetService("GamePassService")
if gService:PlayerHasPass(plr, id) then
print("He/She has the pass!")
end

5 comments

0

with the Player1, that shouldnt be there?

0

I have written out kinda idea in my question

0

Of course you need to define your player. And please upvote, and accept my answer if you feel that your question was answered.

0

I edited it for you, that should help.

0

I dont want it to check a certain player. I want it to check all the players in game.

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