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: Coloring multiple blocks at one time.

Previous Thread :: Next Thread 
DragonOfWar900 is not online. DragonOfWar900
Joined: 11 May 2011
Total Posts: 1508
28 Nov 2013 09:14 AM
Hi, so what i want is that, for example, i have made a model called "PartPack" and inside it has 25 parts, with all of them named "Part", so i want to know how to get all o this parts at one time and color them Bright Red, so its less time consuming.
Report Abuse
NickBlox5726 is not online. NickBlox5726
Joined: 19 Nov 2009
Total Posts: 106
28 Nov 2013 09:20 AM
you could do:
local parts = (PartPack Location):getChildren()
for i,v in pairs(parts) do
parts[i].BrickColor = BrickColor.New("Bright Red")
end

I did this quite quickly so i may have messed up somewhere.
Report Abuse
NickBlox5726 is not online. NickBlox5726
Joined: 19 Nov 2009
Total Posts: 106
28 Nov 2013 09:22 AM
And just in case something is in there that is not a part you should do:
local parts = (PartPack Location):getChildren()
for i,v in pairs(parts) do
if parts[i]:IsA("BasePart")
parts[i].BrickColor = BrickColor.New("Bright Red")
end
end
Report Abuse
NickBlox5726 is not online. NickBlox5726
Joined: 19 Nov 2009
Total Posts: 106
28 Nov 2013 09:23 AM
if parts[i]:IsA("BasePart") then*
Report Abuse
NickBlox5726 is not online. NickBlox5726
Joined: 19 Nov 2009
Total Posts: 106
28 Nov 2013 09:35 AM
Tested it, then realized Its "Bright red" not "Bright Red", so change that and it should work!
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
28 Nov 2013 09:48 AM
Eww
parts[i] could just be replaced with v
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