I'm looking for a way to check if a player has a gamepass, currently my way doesn't work for some reason.
game.Players.PlayerAdded:connect(function(plr) wait(1) if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr, 6058100) then game.ReplicatedStorage.PlayerData:FindFirstChild(plr.Name)["VIP"].Value = 1 end
It looks like you're submitting the entire Player object ("plr") as the first argument of UserOwnsGamePassAsync.
You only need to send the UserId.
Example:
MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamePassID)