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

Why is GamePassService not recognizing gamepasses?

Can anyone tell me why I'm having errors. Thank you.

18:30:12.351 - GamePassId '3041549' is not of type Game Pass. Please use MarketplaceService:PlayerOwnsAsset instead.

I'm pretty sure it's a gamepass, https://www.roblox.com/game-pass/3041549/10-Year-Bazooka-First-Day-Release-Sale

Here's the code I'm using as well.

local BazookaID = 3041549
	if game:GetService("GamePassService"):PlayerHasPass(Player,BazookaID) then 
        print(Player.Name .. " has the game pass!")
    else
        print(Player.Name .. " doesn't have the game pass...")
    end

1 comment

0

How did you get the "Player" Variable?

1 answer

Welp GamePassService is now a legacy function and no longer works.

ROBLOX updated how gamepasses work on April so both :PlayerHasPass and :PlayerOwnsAsset won't work anymore.

The newest and current way to get gamepass is game:GetService("MarketPlaceService"):UserOwnsGamePassAsync(userId, gamePassId)

Replace userId with the target's userId and also replace gamePassId with your gamepass's Id

Enjoy!

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