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

GamePass script isn't working?

I added a gamepass to my game i watched multi videos and i looked at the wiki and i can't find out why it says i don't own the gamepass. (BTW I KNOW FOR SURE I OWN IT)

game.Players.PlayerAdded:Connect(function(plr)
	if game:GetService("GamePassService"):PlayerHasPass(plr, 4936471) then
		print("yes")
	else
		print("no")
	end
end)

1 answer

✓ Accepted answer

You used UserHasGamepass which is Deprecated, you should be using UserOwnsGamePassAsync, also use MarketplaceService instead of GamepassService.

GamepassID = 4936471

game.Players.PlayerAdded:Connect(function(plr)

    if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId, GamepassID) then
        print("yes")
    else
        print("no")
    end

end)

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