Raildex
|
  |
| Joined: 06 Dec 2009 |
| Total Posts: 934 |
|
|
| 27 Jan 2016 12:17 PM |
| How would I set the color of all the parts inside a section of a model. Say in order to change the color of car parts. |
|
|
| Report Abuse |
|
|
Vezious
|
  |
| Joined: 09 Nov 2013 |
| Total Posts: 606 |
|
|
| 27 Jan 2016 12:18 PM |
| A child's color should not matter! All children are the same. They shouldn't be treated differently because of their color. Let them be! |
|
|
| Report Abuse |
|
|
|
| 27 Jan 2016 12:24 PM |
local c = workspace.Model:getChildren() for i = 1, #c do c.BrickColor = BrickColor.new("White") end
|
|
|
| Report Abuse |
|
|
|
| 27 Jan 2016 12:28 PM |
^ lol?
local c = Model:GetChildren() for _,v in ipairs(c) do c.BrickColor = BrickColor.new("White") end
|
|
|
| Report Abuse |
|
|
|
| 27 Jan 2016 12:29 PM |
^lol?
``` for K,V in next, Model:children() do V.BrickColor = BrickColor.Random() end ``` |
|
|
| Report Abuse |
|
|
Vezious
|
  |
| Joined: 09 Nov 2013 |
| Total Posts: 606 |
|
|
| 27 Jan 2016 12:30 PM |
^Lol ^^Lmao ^^^Truuuu
local Model = game.Workspace:FindFirstChild("I Like Turtlez")
for i,v in pairs (Model:GetChildren()) do v.BrickColor = BrickColor.new("White") end
|
|
|
| Report Abuse |
|
|
|
| 27 Jan 2016 12:31 PM |
^^^^lol??
local c = game.Workspace:GetChildren(); for c = 1, #c do if c[c].className == "Part" then c.BrickColor = BrickColor("Grime"); end end |
|
|
| Report Abuse |
|
|
Vezious
|
  |
| Joined: 09 Nov 2013 |
| Total Posts: 606 |
|
|
| 27 Jan 2016 12:33 PM |
^OMG ^^OK ^^Lol ^^^Lmao ^^^^^Truuuu
local Model = game.Workspace:FindFirstChild("I Like Turtlez")
for i,v in pairs (Model:GetChildren()) do if v:IsA("BasePart") then v.BrickColor = BrickColor.new("White") end end
|
|
|
| Report Abuse |
|
|
|
| 27 Jan 2016 12:35 PM |
local function property(instance, key, value) pcall(function() instance[key] = value return (nil); end) for _, child in next, (instance:getChildren()) do property(child, key, value) end end
property(workspace.model, "BrickColor", BrickColor.new("Bright blue")) |
|
|
| Report Abuse |
|
|
| |
|
Vezious
|
  |
| Joined: 09 Nov 2013 |
| Total Posts: 606 |
|
| |
|
| |
|
Vezious
|
  |
| Joined: 09 Nov 2013 |
| Total Posts: 606 |
|
| |
|
|
| 27 Jan 2016 12:39 PM |
^^^^^^^um?
function GetChildren(theParent,tblToLoop,loopThroughDescendants) local loopThroughDescendants = loopThroughDescendants or false local tblToLoop = tblToLoop or {} for i,v in pairs(theParent:GetChildren()) do table.insert(tblToLoop,v); if loopThroughDescendants then GetChildren(v,tblToLoop,true); end end return tblToLoop end local Children = GetChildren(game.Workspace.Model,false,true); for i,v in pairs(Children) do if v:IsA("Part") then script.Parent.BrickColor = BrickColor("White"); end end |
|
|
| Report Abuse |
|
|
|
| 27 Jan 2016 12:41 PM |
No, I'm sorry, its v.BrickColor = BrickColor("White");
not script.Parent.BrickColor = BrickColor("White"); |
|
|
| Report Abuse |
|
|
Vezious
|
  |
| Joined: 09 Nov 2013 |
| Total Posts: 606 |
|
|
| 27 Jan 2016 12:42 PM |
| ^ A tsunami just washed away your sand castle |
|
|
| Report Abuse |
|
|
Raildex
|
  |
| Joined: 06 Dec 2009 |
| Total Posts: 934 |
|
|
| 27 Jan 2016 02:32 PM |
What would I do to get the color from a value. This is what I have so far
carV = backup:clone() carV.Parent = game.Workspace carV:makeJoints() carV:SetPrimaryPartCFrame (script.objectValue.Value.CFrame+Vector3.new(0,5,0)) carV:SetPrimaryPartCFrame (car1.PrimaryPart.CFrame * CFrame.Angles(0,math.rad(180), 0)) print(carV.PrimaryPart) local c = carV.Primary:getChildren() for i = 1, #c do c.BrickColor = script.Parent.Parent.carPrimaryColor end |
|
|
| Report Abuse |
|
|
|
| 27 Jan 2016 02:37 PM |
I'm going to assume script.Parent.Parent.carPrimaryColor
Is a brickColorValue
c.BrickColor = script.Parent.Parent.carPrimaryColor.Value |
|
|
| Report Abuse |
|
|