Kill players on touch.
: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)
Closed as Not Constructive by aquathorn321, M39a9am3R, and Necrorave
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?