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

How do i create a kill script? [closed]

Asked by 8 years ago

Kill players on touch.

0
*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. DeveloperSolo 370 — 8y
0
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". LateralLace 297 — 8y

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?

3 answers

Log in to vote
1
Answered by
pk008 15
8 years ago

:BreakJoints

ex:

script.Parent.Touched:connect(function(hit)
    if hit and hit.Parent then
        hit.Parent:BreakJoints()
    end
end)
Ad
Log in to vote
1
Answered by
Jiptix 2
8 years ago

: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)
Log in to vote
0
Answered by 8 years ago

@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)