andrei012
|
  |
| Joined: 05 Nov 2010 |
| Total Posts: 279 |
|
|
| 09 Aug 2013 11:25 AM |
collide = true for _,v in pairs(script.Parent.Parent:GetChildren())do local function On() script.Parent.BrickColor = BrickColor.new("Bright green") v.CanCollide = true local function Off() script.Parent.BrickColor = BrickColor.new("Really red") v.CanCollide = false script.Parent.ClickDetector.Clicked:connect(function(onClick) if collide == true then Off() if collied == false then On()
end end end) end end end
|
|
|
| Report Abuse |
|
|
andrei012
|
  |
| Joined: 05 Nov 2010 |
| Total Posts: 279 |
|
|
| 09 Aug 2013 11:27 AM |
Sorry here--
collide = true for _,v in pairs(script.Parent.Parent:GetChildren())do local function On() script.Parent.BrickColor = BrickColor.new("Bright green") v.CanCollide = true local function Off() script.Parent.BrickColor = BrickColor.new("Really red") v.CanCollide = false script.Parent.ClickDetector.Clicked:connect(function(onClick) if collide == true then collide = false Off() if collide == false then collide = true On() end end end) end end end
|
|
|
| Report Abuse |
|
|
Xtreme101
|
  |
| Joined: 03 Jan 2009 |
| Total Posts: 4385 |
|
|
| 09 Aug 2013 11:37 AM |
I'd say you have too many ends there but I suspect there's more to the script.
Output? |
|
|
| Report Abuse |
|
|
Soquick
|
  |
| Joined: 01 Nov 2012 |
| Total Posts: 1497 |
|
|
| 09 Aug 2013 11:38 AM |
The problem is on() off() you need more specific names, I tried making a plugin with on() off() and it errored collide = true for _,v in pairs(script.Parent.Parent:GetChildren())do local function TurnOn() script.Parent.BrickColor = BrickColor.new("Bright green") v.CanCollide = true local function TurnOff() script.Parent.BrickColor = BrickColor.new("Really red") v.CanCollide = false script.Parent.ClickDetector.Clicked:connect(function(onClick) if collide == true then collide = false TurnOff() if collide == false then collide = true TurnOn()
end end end) end end end |
|
|
| Report Abuse |
|
|
|
| 09 Aug 2013 11:39 AM |
I think you're mistaking "CanCollide=True" For "Collide=True"
~AgentWaffle~ |
|
|
| Report Abuse |
|
|
Xtreme101
|
  |
| Joined: 03 Jan 2009 |
| Total Posts: 4385 |
|
|
| 09 Aug 2013 11:40 AM |
| What? The entire post didn't load onto my screen when I initially saw it. |
|
|
| Report Abuse |
|
|
andrei012
|
  |
| Joined: 05 Nov 2010 |
| Total Posts: 279 |
|
|
| 09 Aug 2013 11:44 AM |
I ended up with this but the only hting that worked was BrickColor.new = ("Bright green")
collide = true for _,v in pairs(script.Parent.Parent:GetChildren())do local function TurnOn() script.Parent.BrickColor = BrickColor.new("Bright green") v.CanCollide = true end local function TurnOff() script.Parent.BrickColor = BrickColor.new("Really red") v.CanCollide = false end script.Parent.ClickDetector.MouseClick:connect(function(onClick) if collide == true then collide = false TurnOff() if collide == false then collide = true TurnOn() end end end) end |
|
|
| Report Abuse |
|
|
Soquick
|
  |
| Joined: 01 Nov 2012 |
| Total Posts: 1497 |
|
|
| 09 Aug 2013 11:52 AM |
collide = true for _,v in pairs(script.Parent.Parent:GetChildren())do local function TurnOn() script.Parent.BrickColor = BrickColor.new("Bright green") if v:IsA("Part") then v.CanCollide = true end end local function TurnOff() script.Parent.BrickColor = BrickColor.new("Really red") if v:IsA("Part") then v.CanCollide = false end end script.Parent.ClickDetector.MouseClick:connect(function(onClick) if collide == true then collide = false TurnOff() if collide == false then collide = true TurnOn() end end end) end |
|
|
| Report Abuse |
|
|
andrei012
|
  |
| Joined: 05 Nov 2010 |
| Total Posts: 279 |
|
|
| 09 Aug 2013 11:56 AM |
| didnt work eather, same as mine only the color changed to green |
|
|
| Report Abuse |
|
|
andrei012
|
  |
| Joined: 05 Nov 2010 |
| Total Posts: 279 |
|
|
| 09 Aug 2013 11:57 AM |
collide = true for _,v in pairs(script.Parent.Parent:GetChildren())do script.Parent.ClickDetector.MouseClick:connect(function(onClick) if collide == true then script.Parent.BrickColor = BrickColor.new("Lime green") v.CanCollide = true collide = false TurnOff() end if collide == false then script.Parent.BrickColor = BrickColor.new("Really red") v.CanCollide = false collide = true TurnOn() end end) end
try these it turns red but not green Lol |
|
|
| Report Abuse |
|
|
andrei012
|
  |
| Joined: 05 Nov 2010 |
| Total Posts: 279 |
|
| |
|
Soquick
|
  |
| Joined: 01 Nov 2012 |
| Total Posts: 1497 |
|
| |
|
andrei012
|
  |
| Joined: 05 Nov 2010 |
| Total Posts: 279 |
|
| |
|
andrei012
|
  |
| Joined: 05 Nov 2010 |
| Total Posts: 279 |
|
| |
|