generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: For i=1 - CanCollide help

Previous Thread :: Next Thread 
Protune is not online. 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 is not online. 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
NowDoTheHarlemShake is not online. NowDoTheHarlemShake
Joined: 18 Feb 2013
Total Posts: 1911
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image