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

How do you make an object kill you when you touch it? [SOLVED]

Asked by 11 years ago

I want there to be a piece to kill me and other players when they touch it.

1 answer

Log in to vote
0
Answered by 11 years ago

Put this script into whatever brick that you want it to kill you.

01function onTouched(hit)
02 
03local h = hit.Parent:findFirstChild("Humanoid")
04 
05if h ~= nil then
06 
07h.Health = 0
08 
09end
10end
11script.Parent.Touched:connect(onTouched)
0
Remember to hit this as the answer if it works. yzeerf1313 25 — 11y
Ad

Answer this question