HuntHello
|
  |
| Joined: 19 Jan 2011 |
| Total Posts: 577 |
|
|
| 15 Aug 2012 07:20 PM |
I cannot figure out a script that removes bricks that hit the script's parent. I tried
function onTouched(hit) hit:remove() end script.Parent.Touched:connect(onTouched)
But it only removes legs and other limbs, but does not removes bricks that it touches.
Please help me! Thanks! |
|
|
| Report Abuse |
|
|
jmr11b
|
  |
| Joined: 19 Aug 2010 |
| Total Posts: 806 |
|
|
| 15 Aug 2012 07:31 PM |
| Wait its supposed to remove your player when you touch it? |
|
|
| Report Abuse |
|
|
HuntHello
|
  |
| Joined: 19 Jan 2011 |
| Total Posts: 577 |
|
|
| 15 Aug 2012 07:38 PM |
No, I want it to remove a falling ball when it touches the script's parent.
Thanks for help! |
|
|
| Report Abuse |
|
|
jmr11b
|
  |
| Joined: 19 Aug 2010 |
| Total Posts: 806 |
|
|
| 15 Aug 2012 07:38 PM |
Umm... if so do this: function onTouch(hit) hit.Parent:remove() end script.Parent.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
|
| 15 Aug 2012 07:42 PM |
Even better:
script.Parent.Touched:connect(function(hit) hit.Parent:Destroy()() end)
~2.9k posts/20k posts |
|
|
| Report Abuse |
|
|
|
| 15 Aug 2012 07:43 PM |
Ooops, added an extra () on accident xD
script.Parent.Touched:connect(function(hit) hit.Parent:Destroy() end)
~2.9k posts/20k posts |
|
|
| Report Abuse |
|
|
HuntHello
|
  |
| Joined: 19 Jan 2011 |
| Total Posts: 577 |
|
| |
|