players = game.Players:GetPlayers()
for i,v in pairs(players) do
check = game.Workspace:findFirstChild(v.Name)
if check then
hum = game.Workspace:findFirstChild(check)
if hum then
v.Character.Humanoid.Health = 0
end
COMMUNITY QUESTION
Help on A for loop??
1 answer
Line 5~
It says hum = game.Workspace:findFirstChild(check). It should be something like hum = check:findFirstChild("Humanoid")
You also forgot some ends.
Altogether, it should look something like...
players = game.Players:GetPlayers()
for i,v in pairs(players) do
check = game.Workspace:findFirstChild(v.Name)
if check then
hum = check:findFirstChild("Humanoid")
if hum then
v.Character.Humanoid.Health = 0
end
end
end
Oh, and if you just want to kill everyone...
Players = game:service("Players")
for i, v in pairs(Players:GetPlayers()) do
pcall(function()
v.Character.Humanoid.Health = 0
end)
end
Well, hope this was helpful at all....
- Kratos232
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Where are all your ends?
I put theme all but it still dont work :/