I was wondering if it was possible to color a whole model within a script. I know you can't use BrickColor as that's only to change one brick. I've been trying to find out if there's a command like BrickColor but can't seem to find anything. Any help is appreciated.
✓ ANSWER ACCEPTED
Is it possible to color a whole model?
2 answers
✓ Accepted answer
No, you can't do anything like that. But, you could use a function like this that basically continually searches the children of the model and colors the parts accordingly:
local color = BrickColor.new() -- what color you want the parts to be
local model = game.Workspace.Model -- the model you want to color
function changeColor(par)
for _,v in pairs (par:GetChildren()) do -- loops through a model's children
if v:IsA("BasePart") then -- checks to see if the child is part, wedge, etc
v.BrickColor = color -- changes it's color
end
changeColor(v) -- the function repeats itself with the childs the parent
end
end
changeColor(model) -- calls the function
Hopefully you can understand this script and my comments. If you need more help, be sure to comment!
Hope I helped!
~TDP
try ungrouping the model and color it manually?
1 comment
0
It's a car. I can't ungroup it.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
The if check for the children is redundant.
Fixed.
Thanks! This helped a lot.