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
 

Coloring a whole model at once

Previous Thread :: Next Thread 
COMMANDERREX12345345 is not online. COMMANDERREX12345345
Joined: 18 Jun 2009
Total Posts: 1316
22 Feb 2013 01:38 AM
how would I write a script to color every brick in a model?
this is what I got.
m = Workspace.Model:GetChildren()
if m.ClassName = "Part"
then m.BrickColor = BrickColor.new("color")
end
end
Report Abuse
Struanmcd is not online. Struanmcd
Joined: 19 Sep 2008
Total Posts: 369
22 Feb 2013 03:20 AM
I'm writing this on the fly, but I believe it would look something like this

for _, v in pairs(game.Workspace.Model:GetChildren()) do
if v.ClassName == "Part" then
v.BrickColor = BrickColor.new("Really Red")
end
end
Report Abuse
cart6157 is not online. cart6157
Joined: 28 Feb 2009
Total Posts: 2194
22 Feb 2013 07:57 AM
Lol, it's like he deleted a line because there are two ends.
Report Abuse
bibo5o is not online. bibo5o
Joined: 17 Jan 2009
Total Posts: 414
22 Feb 2013 08:25 AM
model = --idk where your model is, you have to put that part in :p

c = model:GetChildren()
for i = 1, #c do
if c[i].className == "Part" then
c[i].BrickColor = BrickColor.new() --add color here
end
end

Hope this works, but I'm no expert scripter
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