TomCat88
|
  |
| Joined: 03 Dec 2011 |
| Total Posts: 8971 |
|
|
| 11 Dec 2013 09:56 PM |
p = game.Workspace:GetChildren() for i = 1, #p do if p[i]:IsA("Part") and p[i].BrickColor == BrickColor.new("Bright green") then p[i].BrickColor = BrickColor.new("White") else end end
//-TC [wARC] |
|
|
| Report Abuse |
|
|
TomCat88
|
  |
| Joined: 03 Dec 2011 |
| Total Posts: 8971 |
|
| |
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 11 Dec 2013 10:04 PM |
| Maybe the object you're trying to recolor is a model. |
|
|
| Report Abuse |
|
|
|
| 11 Dec 2013 10:14 PM |
Yeah, you should use recursion
function Recolor(Child,Color) for i,v in pairs(Child:GetChildren()) do if v:IsA('BasePart') then v.BrickColor=Color end Recolor(v,Color) end end
Recolor(Workspace,BrickColor.White()) |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 11 Dec 2013 10:15 PM |
You might wanna modify above
function Recolor(Child,Color) for i,v in pairs(Child:GetChildren()) do if v:IsA('BasePart') then v.BrickColor=Color elseif v:IsA("Model") then Recolor(v,Color) end end end
Recolor(Workspace,BrickColor.White()) |
|
|
| Report Abuse |
|
|
|
| 11 Dec 2013 10:18 PM |
| I didn't bother to put a check for a model because some people actually put parts in other parts and stuff. |
|
|
| Report Abuse |
|
|