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

Why is GamePassService not recognizing gamepasses?

Asked by
Radstar1 270 Moderation Voter
6 years ago
Edited 6 years ago

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
0
How did you get the "Player" Variable? User#19524 175 — 6y

1 answer

Log in to vote
0
Answered by 5 years ago

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!

Ad

Answer this question