GamePassService:PlayerHasPass not working properly

I’ve been trying to set up a gamepass on my game, but it seems to think the ID i’m giving it is not a gamepass.
The game i’m trying this in is a joke (as you can see from the name and thumbnail), but nevertheless it’s being problematic.


The gamepass i’m trying to check for is this:
https://www.roblox.com/game-pass/4900778/change-server-music
The line of code that checks for the gamepass is return gps:PlayerHasPass(player, 4900778) (gps referring to GamePassService)
Yet, every time I check for it the console returns:
23:31:59.693 - GamePassId ‘4900778’ is not of type Game Pass. Please use MarketplaceService:PlayerOwnsAsset instead.
It obviously is a gamepass, which is why I’m stumped on how to fix it. If this is a problem with the way I’m using the service or something, please tell me cause at this point I’m at a loss, although I assume this is some sort of bug.
Do note that I have also tried following it’s instructions in using MarketplaceService, although I am again redirected to using GamePassService, with it saying that it is a gamepass.
Edit: I’ve found that this bug only occurs in studio, although false is returned in-game with no error even though I am quite sure that I have the gamepass in my inventory.

1 Like

The issue you’re encountering is, I believe related to this change:

1 Like

That seems to have worked, never noticed that post rip
Although, I find it strange the warning still tells me to use PlayerOwnsAsset since a new method has been put in place, not sure if I should make a completely new bug report for that though.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.