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
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....