|
| 09 Aug 2011 08:25 AM |
So if I need onTouch the "Parent" brick..
Door, Door2, Door3, Door4, Door5 CanCollides = false..?
How to make that run correctly?
My version won't do it sadly.
So first I made the variables to make the thing easier, and than I made onTouch the parent all those doors have the same effect, but as for the results, only 1 random door had the effect!
Door = script.Parent.Parent.Door Door2 = script.Parent.Parent.Door2 Door3 = script.Parent.Parent.Door3 Door4 = script.Parent.Parent.Door4 Door5 = script.Parent.Parent.Door5
function OnTouch(hit) Door.Transparency = 0.5 Door.CanCollide = false end
function OnTouch(hit) Door2.Transparency = 0.5 Door2.CanCollide = false end
function OnTouch(hit) Door3.Transparency = 0.5 Door3.CanCollide = false end
function OnTouch(hit) Door4.Transparency = 0.5 Door4.CanCollide = false end
function OnTouch(hit) Door5.Transparency = 0.5 Door5.CanCollide = false end
script.Parent.Touched:connect(OnTouch) |
|
|
| Report Abuse |
|
|
| |
|
Nartle
|
  |
| Joined: 29 Mar 2008 |
| Total Posts: 7202 |
|
|
| 09 Aug 2011 08:28 AM |
I'm not really good at scripting, but are you putting this in the workspace? >_>
I'm probably stupid at asking that, but if you aren't putting the script in the door, the only thing that makes me not confused would be doing, oh wait I'm still confused about your script, I'd have to make it in my map first >_> |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2011 08:29 AM |
| This way look at your last post of this script... |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2011 10:41 AM |
| maybe there are so many doorws and so many of the same script on one script, maybe the game is confused, try making the door1, door2, door3 and so on on different scripts |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2011 10:50 AM |
function OnTouch(hit) Door.Transparency = 0.5 Door.CanCollide = false Door2.Transparency = 0.5 Door2.CanCollide = false Door3.Transparency = 0.5 Door3.CanCollide = false Door4.Transparency = 0.5 Door4.CanCollide = false Door5.Transparency = 0.5 Door5.CanCollide = false end script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|