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

1 comment
Irrelevant side comment: I noticed you're using "connect" in your original post. That still technically works, but "connect" has been deprecated in favor of the capitalized "Connect" (it's usually a preferred practice to capitalize the names of these functions)