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

How do you make a kill script not specific to one person?

Asked by 8 years ago

I want to make a universal way to cut off a limb or kill someone in the workspace for doing a certain action.

0
This is not a request site please add code that needs to be fixed and the error or what needs to be fixed. LostPast 253 — 8y

1 answer

Log in to vote
0
Answered by
LostPast 253 Moderation Voter
8 years ago
script.Parent.Touched:connect(function(hit) --touched is when a player touches the parent of this script.
    if hit.Parent and hit.Parent:FindFirstChild("Humanoid") then --checks to make sure it is a player
hit.Parent.Humanoid:TakeDamage(100)--amount of damage to deal to the player.
hit:Destroy() --removes the limb.
    end
end)

put this in a normal script inside of the part you want to take a limb, and kill the player with.

Ad

Answer this question