|
| 16 Nov 2014 12:49 AM |
At the bottom of my script I have this
group = script.Parent.Climb:GetChildren()
for i = 1, #group do group[i].Touched:connect(onTouched) end
Now, that works as intended--whenever any of the children in script.Parent.Climb get touched it goes to the main part of the script.
This is my problem--I want to reference the specific part that was touched, but using group[i] won't work so I don't what to do. |
|
|
| Report Abuse |
|
|
|
| 16 Nov 2014 01:38 AM |
| in the ontouched script, make it so it will take note of the block it was touched on, like if you are making a brick transparent, so instead of part.Transparancy, do Part.Name. |
|
|
| Report Abuse |
|
|
|
| 16 Nov 2014 02:21 AM |
"in the ontouched script, make it so it will take note of the block it was touched on"
That's what I'm asking how to do. |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 16 Nov 2014 02:37 AM |
Change onTouched to this
function onTouched(hit, part)
group = script.Parent.Climb:GetChildren()
for i = 1, #group do group[i].Touched:connect(function(hit) onTouched(hit, group[i]) end) end
Now the reference to the part that was touched in the onTouched function would be called part
The potato speaks the truth |
|
|
| Report Abuse |
|
|
| |
|