i have a script that when a player joins it detects if a player has a gamepass. I try to figure out why it doesn't work but nothing works. Why doesn't it work?
game.Players.PlayerAdded:Connect(function(player) local value = Instance.new("BoolValue",player) value.Name = "HasHazardShow" local service = game:GetService("MarketplaceService") if service:PlayerOwnsAsset(game.Players[player.Name], 5115790)then value.Value = true else value.Value = false end end)
You can't do that, the correct function for a gamepass is UserOwnsGamePassAsync
since gamepasses are not assets.
if service:UserOwnsGamePassAsync(player.UserId, 5115790)then