Hi, I am trying to check if the player has a certain Gamepass using PlayerHasPass in a LocalScript .
I do this by invoking a server like so:
-- LocalScript in StarterCharacterScripts
local checkGamepass = game.ReplicatedStorage:WaitForChild("checkGamepass")
if checkGamepass:InvokeServer(123456) then
print("True")
else
print("False")
end
-- ServerScript in ServerScriptService
local checkGamepass = Instance.new("RemoteFunction",game.ReplicatedStorage)
checkGamepass.Name = "checkGamepass"
checkGamepass.OnServerInvoke = function(player,id)
if game:GetService("GamePassService"):PlayerHasPass(player,id) then
return true
end
return false
end
For some reason, this doesn't work. In an actual game it always comes up with ´´false´´ (even though I do own the pass) and in Roblox Studio it just comes up with
"GamePassId '123456' is not of type Game Pass. Please use MarketplaceService:PlayerOwnsAsset instead."
Take in mind that the ID I used in this question isn't the actual ID for the gamepass. I just occulted it for privacy reasons. The real ID is a gamepass, however.

1 comment
GamePassService is old