Protune
|
  |
| Joined: 17 Sep 2010 |
| Total Posts: 147 |
|
|
| 26 Jul 2014 06:45 AM |
I want it so that when I touch a brick, it sets CanCollide to false on all bricks in a model.
Current script:
local Track1 = script.Parent.Parent.Parent.Track1 local Track2 = script.Parent.Parent.Parent.Track2
script.Parent.Touched:connect(function(h) a = Track1:GetChildren() for i = 1, #a do a[i].CanCollide = false end end)
I however get an error at the CanCollide part: (CanCollide is not a valid member of model)
Please help! Thank you! |
|
|
| Report Abuse |
|
|
alij12
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 1204 |
|
|
| 26 Jul 2014 06:47 AM |
local Track1 = script.Parent.Parent.Parent.Track1 local Track2 = script.Parent.Parent.Parent.Track2
script.Parent.Touched:connect(function(h) a = Track1:GetChildren() for i,v in pairs(a) do v.CanCollide = false end end) |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2014 06:58 AM |
script.Parent.Touched:connect(function(h) a = Track1:GetChildren() for i = 1, #a do if a[i].ClassName == "Part" then a[i].CanCollide = false end end end) |
|
|
| Report Abuse |
|
|