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
 

Changing properties of all Bricks in a model

Previous Thread :: Next Thread 
Kondou is not online. Kondou
Joined: 05 Aug 2012
Total Posts: 1148
19 Feb 2013 04:17 PM
How would I go about it besides going

brickone.CanCollide = true
bricktwo.CanCollide = true

And so on, basically change a property of a lot of bricks in a model without having to type a line for each brick.
Report Abuse
BornLeader1 is not online. BornLeader1
Joined: 02 Jun 2011
Total Posts: 1795
19 Feb 2013 04:21 PM
for i,v in pairs(the model you want:GetChildren()) do
if v.className == "Part" then
v.CanCollide = true
end
end

that should work if you name "the model you want" correctly.
~Born2Lead
Report Abuse
Kondou is not online. Kondou
Joined: 05 Aug 2012
Total Posts: 1148
19 Feb 2013 04:57 PM
I made this script which would change the bricks in the Grass model to the designated color in 20 seconds, then to another, but it doesn't work...

while true do wait(20)
for i,v in pairs(game.Workspace.Grass:GetChildren()) do
if v.className == "Part" then
v.BrickColor = BrickColor.new("White")
wait(20)
v.BrickColor = BrickColor.new("Dark green")
wait(20)
v.BrickColor = BrickColor.new("White")
end
end
end

Did I miss something?
Report Abuse
SlenderStudios is not online. SlenderStudios
Joined: 16 Aug 2012
Total Posts: 76
19 Feb 2013 05:50 PM
while true do
wait(20)
for _, v in pairs(Game.Workspace.Grass:GetChildren()) do
if v.ClassName == "Part" then
v.BrickColor = BrickColor.new("White")
end
end
wait(20)
for _, v in pairs(Game.Workspace.Grass:GetChildren()) do
if v.ClassName == "Part" then
v.BrickColor = BrickColor.new("Dark green")
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