Kill players on touch.
✓ ANSWER ACCEPTED
How do i create a kill script?
3 answers
✓ Accepted answer
:BreakJoints
ex:
script.Parent.Touched:connect(function(hit)
if hit and hit.Parent then
hit.Parent:BreakJoints()
end
end)
:BreakJoints works and has less lines, but changing the player's Max health to 0 works also, and for some players who lag, this may have a quicker response than :BreakJoints
function onTouched(hit)
local human = hit.Parent:findFirstChild("Humanoid")
if (human == nil) then return end
human.MaxHealth = 0
human.Health = human.MaxHealth
end
script.Parent.Touched:connect(onTouched)
@Jiptix :BreakJoints is perfectly fine, since it doesn't run on the client side so I doesn't matter.
-- Here is a kill script the will only word if they are a Player in the game
script.Parent.Touched:connect(function(Hit)
if game["Players"]:GetPlayerFromCharacter(Hit.Parent) ~= nil then
local Player = game["Players"]:GetPlayerFromCharacter(Hit.Parent)
Player.Character:BreakJoints()
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Sigh hack doesn't accept answers.. Still we make the script's to help to for fun. If it's a simple script (this) then I guess it's fine, but if its like a really long and advance script, people might get ticked. Also isnt hack breaking the question guideline, he's not giving us a script showing us what he tried. Just making us do it for him. Just saying.
Well if you put it *that way, yeah. The thing is, it seems like there are less people to keep track of questions and answers later at night, and on holidays like today. It seems like the system is based more on "majority rules" rather than the "communtity guidlines".