|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 19 Jan 2011 |
| Total Posts: 577 |
|
|
| 26 Jul 2014 02:33 PM |
| Top the problem with that is models |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 19 Jan 2011 |
| Total Posts: 577 |
|
|
| 26 Jul 2014 02:40 PM |
you guys, Just saying models won't get colored. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 26 Jul 2014 03:17 PM |
| MODELS WILL GET COLORED WITH MY SCRIPT. DO YOU KNOW WHAT RECURSIVE MEANS? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|