WALLE112
|
  |
| Joined: 26 Jul 2008 |
| Total Posts: 712 |
|
|
| 25 Apr 2012 10:48 PM |
Why does this no longer work everytime?
function onTouch(hit)
hit.Parent:BreakJoints()
end
script.Parent.Touched:connect(onTouch)
Only works once. |
|
|
| Report Abuse |
|
|
| |
|
WALLE112
|
  |
| Joined: 26 Jul 2008 |
| Total Posts: 712 |
|
|
| 25 Apr 2012 10:49 PM |
| Is there a way to make it work more than once? |
|
|
| Report Abuse |
|
|
Legend26
|
  |
| Joined: 08 Sep 2008 |
| Total Posts: 10586 |
|
|
| 25 Apr 2012 11:25 PM |
There won't_always_necessarily be a parent, so add a check for that.
function onTouch(hit) if not hit.Parent then return end hit.Parent:BreakJoints() end
script.Parent.Touched:connect(onTouch)
|
|
|
| Report Abuse |
|
|
Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 25 Apr 2012 11:46 PM |
I think my code looks prettier:
script.Parent.Touched:connect(function(Hit) if Hit and Hit.Parent then Hit.Parent:BreakJoints() end end) |
|
|
| Report Abuse |
|
|
DXPower
|
  |
| Joined: 21 Oct 2008 |
| Total Posts: 2866 |
|
|
| 26 Apr 2012 06:38 AM |
Are you wanting the WHOLE model to break?
With a Five-Guys burger in my hands, I am now invincible! |
|
|
| Report Abuse |
|
|
|
| 26 Apr 2012 07:32 AM |
| That is bad you could be breaking the joints of the Workspace. |
|
|
| Report Abuse |
|
|