|
| 30 Nov 2013 11:53 PM |
Hey guys,
How would I have an ontouched function with a group of bricks with the same name.
Example: Every special brick is named Killbrick, killbrick's would have a global function detecting an ontouched event.
Thanks! |
|
|
| Report Abuse |
|
|
Laedere
|
  |
| Joined: 17 Jun 2013 |
| Total Posts: 23601 |
|
|
| 30 Nov 2013 11:54 PM |
function touched(part) if part.Name == script.Parent then --stuff end end script.Parent.Touched:connect(touched) |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2013 11:55 PM |
| I'm talking about one script detecting a group of bricks with the same name. |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2013 11:55 PM |
Make a for pair loop and add a touched event to each value in the loop. Then have the touched event connect to on function and viola!
"Ladies and gentlemen, take my advice. Pull down your pants and slide on the ice" |
|
|
| Report Abuse |
|
|
Laedere
|
  |
| Joined: 17 Jun 2013 |
| Total Posts: 23601 |
|
|
| 30 Nov 2013 11:55 PM |
| i don't really know what you mean |
|
|
| Report Abuse |
|
|
|
| 30 Nov 2013 11:56 PM |
Thanks, I appreciate it.
-Vanilla |
|
|
| Report Abuse |
|
|