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
 

Quickly recolor all Workspace objects of a certain color?

Previous Thread :: Next Thread 
Distortional is not online. Distortional
Joined: 22 Nov 2011
Total Posts: 6530
26 Jul 2014 01:51 PM
Trying to change all Bright orange objects to Dark stone grey. Table of some sort.

Caaaactus. Prov 3:5: Trust in the LORD with all your heart and lean not on your own understanding.
Report Abuse
Distortional is not online. Distortional
Joined: 22 Nov 2011
Total Posts: 6530
26 Jul 2014 01:57 PM
b1

Caaaactus. Prov 3:5: Trust in the LORD with all your heart and lean not on your own understanding.
Report Abuse
HuntHello is not online. HuntHello
Joined: 19 Jan 2011
Total Posts: 577
26 Jul 2014 02:09 PM
You could use FindFirstChild("Part", true) if all objects are named part
Or you could make a script that replicates itself into all parts and colors all the bricks
That's what I did anyways.
Report Abuse
veryveryveryhidden is not online. veryveryveryhidden
Joined: 16 Dec 2012
Total Posts: 486
26 Jul 2014 02:12 PM
function recolor(prev, new, where)
for _, v in pairs(where:GetChildren()) do
recolor(prev, new, v)
if v:IsA("BasePart") and v.BrickColor==prev then
v.BrickColor=new;
end
end
end


recolor(BrickColor.new("Really red"), BrickColor.new("Really blue"), Workspace) --Will change really red parts to really blue, recursive in Workspace.
Report Abuse
HuntHello is not online. HuntHello
Joined: 19 Jan 2011
Total Posts: 577
26 Jul 2014 02:33 PM
Top the problem with that is models
Report Abuse
FadingGalaxy is not online. FadingGalaxy
Joined: 24 Jul 2014
Total Posts: 42
26 Jul 2014 02:39 PM
for i,v in pairs(workspace:GetChildren()) do
if v.BrickColor == "Bright orange" then
v.BrickColor = BrickColor.new("Dark stone grey")
end
end
Report Abuse
HuntHello is not online. HuntHello
Joined: 19 Jan 2011
Total Posts: 577
26 Jul 2014 02:40 PM
you guys,
Just saying models won't get colored.
Report Abuse
FadingGalaxy is not online. FadingGalaxy
Joined: 24 Jul 2014
Total Posts: 42
26 Jul 2014 02:42 PM
for i,v in pairs(workspace:GetChildren()) do
if v.BrickColor == "Bright orange" then
v.BrickColor = BrickColor.new("Dark stone grey")
end
end

for _,v in pairs(workspace:GetChildren()) do
if v:IsA("Model") then
local child = v:GetChildren()
if child.BrickColor == "Bright orange" and child:IsA("Part") then
child.BrickColor = BrickColor.new("Dark stone grey")
end
end
end
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
26 Jul 2014 02:44 PM
local recurse;
local callback = function(key, value) if value:IsA("BasePart") then value.BrickColor = BrickColor.new("Really red"); end end;

recurse = function(parent, rec)
local children = parent:GetChildren();
for key = 1, #children do
local value = children[key];
callback(key, value);
if rec then recurse(value:GetChildren(), true); end
end
end;

recurse(workspace, true);
Report Abuse
veryveryveryhidden is not online. veryveryveryhidden
Joined: 16 Dec 2012
Total Posts: 486
26 Jul 2014 03:17 PM
MODELS WILL GET COLORED WITH MY SCRIPT. DO YOU KNOW WHAT RECURSIVE MEANS?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
26 Jul 2014 03:18 PM
Mine does that as well.
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