I am trying to add a new gamepass. However for some reason the code I use to check whether the player has the gamepass always returns false. I honestly dont know what causes it. I uploaded the gamepass hours ago, so roblox must’ve registered that i have the gamepass.
game.Players.PlayerAdded:connect(function(p)
wait(0.5)
if game:GetService("GamePassService"):PlayerHasPass(p,5119145) then
print("Yes")
game.ServerStorage.DisinfectionGrenadee:Clone().Parent = p.Backpack
game.ServerStorage.DisinfectionGrenadee:Clone().Parent = p.StarterGear
else
print("no")
end
end)
-- Check if the player already owns the game pass
local success, message = pcall(function()
hasPass = MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamePassID)
end)