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 10 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 10 years ago

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

function onTouched(hit)

local h = hit.Parent:findFirstChild("Humanoid")

if h ~= nil then

h.Health = 0

end
end
script.Parent.Touched:connect(onTouched)

0
Remember to hit this as the answer if it works. yzeerf1313 25 — 10y
Ad

Answer this question