|
| 19 Jul 2012 11:56 AM |
What it does is when the brick this script is in is touched by something called "Bodypart" both bricks joints are broken.
function OnTouched(hit) if hit.Parent.Name == "Bodypart" then hit:BreakJoints() part.Touched:connect(OnTouched) |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2012 11:59 AM |
function OnTouched(hit) if hit.Name == "Bodypart" then hit:BreakJoints() end part.Touched:connect(function(hit) OnTouched(hit) end)
|
|
|
| Report Abuse |
|
|
tyridge77
|
  |
| Joined: 21 Dec 2009 |
| Total Posts: 179 |
|
|
| 19 Jul 2012 12:02 PM |
Actually, you don't need to connect an anonymous function to this. You could just code function OnTouched(hit) if hit.Name == "Bodypart" then hit:BreakJoints() end end part.Touched:connect(OnTouched) |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2012 12:03 PM |
function OnTouched(hit) if hit.Name == "Bodypart" then hit:BreakJoints() end - You need 2 ends to end the function, and if statement end part.Touched:connect(OnTouched) - Idk if it should be hit.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|