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

Why is PlayerHasPass not working with my GamePassId?

This script is supposed to print text if a player has a gamepass, but it just gives me this error:

GamePassId '4628742' is not of type Game Pass. Please use MarketplaceService:PlayerOwnsAsset instead.

That is the gamepass' id, so I don't get why it's not working... Any help would be appreciated.

Player=script.Parent.Parent.Parent.Parent.Parent.Parent.Parent
local gamepass = script:WaitForChild("GamePassId")
local service = game:GetService("GamePassService")

script.Parent.MouseButton1Click:connect(function()
	if service:PlayerHasPass(Player,gamepass.Value) then
	print("Player Has Game pass!")
end)

3 comments

0

Why is player ser to 10 parents?

0

Yes

0

Also I'm pretty sure that PlayerHasPass doesn't work anymore. They added a update so now game passes have there own custom ID's like badges.

1 answer

I managed to fix it. It was so confusing though. I get it now though.

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