pcall(function() game.Players.PlayerAdded:connect(function(player) if game.MarketplaceService:UserOwnsGamePassAsync(player, 8511832) then repeat wait() until game.ServerStorage.PlayerMoney local cashmoney = game.ServerStorage.PlayerMoney:WaitForChild(player.Name) cashmoney.Value = cashmoney.Value + 999999999 end end) end)
I don't know why this isn't working. I've tested both 'UserOwnsGamepassAsync' and 'PlayerHasPass' but nothing happens.
MarketplaceServiceās method UserOwnsGamePassAsync
requires the first argument to be the UserId
of the Player it is verifying the asset to. This is required so it can find the account data.
You passed the Player Object, which is only used for game-related purposes.