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

Why wont this script kill players?

Asked by 9 years ago
local hum=game.Players:GetPlayers()game.Players.NumPlayers.Character:FindFirstChild("Humanoid")
    if hum then
        hum.Health = 0
        end

This piece of code wont kill players

local hum is supposed to be on one line but it wont fit.

0
Well the local variable is real confusing, you want it to get the players then get the number of players, you have this garbage in there, do you want it to just kill everyone? NinjoOnline 1146 — 9y
0
Use the output sometimes, Rabid. It's very useful for detecting most syntactical errors. Redbullusa 1580 — 9y

1 answer

Log in to vote
-1
Answered by 9 years ago

Instead of the hum.health, maybe try moving the hum.Parent.Head up 1 stud on the Y axis. If the player's head or torso are dislocated from it's body, it dies.

Ad

Answer this question