|
| 02 Feb 2012 07:17 PM |
| I need a block that can kill people when you touch it, like lava. I got everything placed out, but I don't know the script to kill someone when they touch the block. What do I do? |
|
|
| Report Abuse |
|
|
mage11561
|
  |
| Joined: 03 Sep 2008 |
| Total Posts: 13217 |
|
|
| 02 Feb 2012 07:18 PM |
function onTouched(p) a = p.Parent.Humanoid if a then a.Health = 0 end end script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
L2000
|
  |
| Joined: 03 Apr 2008 |
| Total Posts: 77448 |
|
|
| 02 Feb 2012 07:20 PM |
We're not allowed to do requests until someone tries it themselves, but I'll give you this since it's very easily found from free models.
db = false lava.Touched:connect(function(hit) if not db then db = true if hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid") then hit.Parent.Humanoid.Health = 0 end wait() db = false end end)
Edit lava for whatever part you want to kill on touch. |
|
|
| Report Abuse |
|
|
|
| 02 Feb 2012 07:40 PM |
OnTouch Humanoid.MaxHealth=0 wait (3) return true |
|
|
| Report Abuse |
|
|
|
| 02 Feb 2012 07:42 PM |
One liner :D
script.Parent.Touched:connect(function(h) pcall(function() h.Parent:BreakJoints() end) end) |
|
|
| Report Abuse |
|
|
| |
|