so, i have a TD wave system working perfectly. But, when try to give money to every player in the server, it only gives it to one person. this is part of my wave script.
task.wait(10)
for wave = 1,10 do
print("wave "..wave.." starting")
if wave == 1 then
mob.Spawn("NormalZombie", 3, map)
elseif wave == 2 then
mob.Spawn("NormalZombie", 4, map)
elseif wave == 3 then
mob.Spawn("NormalZombie", 5, map)
elseif wave == 4 then
mob.Spawn("NormalZombie", 6, map)
elseif wave == 5 then
mob.Spawn("SwiftZombie", 4, map)
elseif wave > 5 then
moneyPerWave = 75
mob.Spawn("NormalZombie", 8, map)
mob.Spawn("SwiftZombie", 3, map)
mob.Spawn("TankyZombie", 4, map)
end
repeat
task.wait(1)
until #workspace.Mobs:GetChildren() == 0 or gameOver
if gameOver then
print("game ended")
break
end
print("wave "..wave.." ending")
for i, plrs in ipairs(game.Players:GetPlayers()) do
plrs.leaderstats.Money.Value += moneyPerWave
break
end
task.wait(1)
end