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

Gamepass is not a gamepass? O.o

I'm developing a simple game which currently has one gamepass. For some reason if a player has the gamepass it doesn't work. Here's what the output says:

20:08:58.065 - GamePassId '4447283' is not of type Game Pass. Please use MarketplaceService:PlayerOwnsAsset instead. (x2)

This item is clearly a gamepass but the output always says it's not. Interestingly enough, the buy screen appears when PromptGamePassPurchase is called even though it causes output to say the same thing above.

Here is the script of a remote function if it'll help

local GamePassService = game:GetService('GamePassService')

function script.Parent.OnServerInvoke(plr, id)
	if GamePassService:PlayerHasPass(plr, id) then
		return true
	else		
		return false
	end
end

3 comments

0

Try getting a gamepass script off free models and test your gamepass ID with it

0

So I found a free model which checks is player has a pass and it causes the same error :\

0

if*

1 answer

Please refer to this question I have answered before regarding gamepasses. It provides some updated code with the new gamepass system.

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