Like lets say I have multiple parts, green, in my game and I wanted to change them all to white. It would take me forever to click through all my models and change the parts manually. Is it possible for me to make a script to go through every part and change the color automatically?
✓ ANSWER ACCEPTED
Is There a Way to Make Changes in Your Game Permanent Through Scripting?
1 answer
✓ Accepted answer
Use a for loop in the command bar
for _,v in pairs(model:GetChildren()) do
v.Color=Color3.fromRGB(255,255,255)
end
If you can't find it click on the views tab of studio and click on command bar
Edit: To get all descendants of the model
for _,v in pairs(model:GetDescendants()) do
if v:IsA("BasePart") then
v.Color=Color3.fromRGB(255,255,255)
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
That would work if the children didn't have children themselves, I need a recursive function to change the colors of the children if the part has any
@xXCyberProXx edited answer
Ah, Thank you!