game.Players.(Playername).leaderstats.Cash.Value = number
So the code below is a test for my game. However, I don't want it to be a particular player, I want it to include all players in the server. For example I don't want it to be one player like this: game.Players.Playername
Instead I want it to be all players.
Can you help me find a code that does the exact same function but with all players included in the server?
Thanks.
for
loop, to iterate through the players. v
will be the player being iterated through. So you can use v.leaderstats
, v.Character
, etc.for _, v in pairs(game:GetService("Players"):GetPlayers()) do -- Code end