Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Whats wrong with this for loop?

Asked by 10 years ago
players = game.Players:GetPlayers()
for i,v in pairs(players) do
                v.Character.Humanoid.Health = 0
            end
0
need a wait() NinjoOnline 1146 — 10y
0
What error are you getting? adark 5487 — 10y

1 answer

Log in to vote
0
Answered by 10 years ago

You aren't checking if the player has a character, that's the problem.

Ad

Answer this question