You are able to iterate through all of the descendants of the model (which includes every object inside it), and change the colour of each object inside. You must check if each object is a BasePart (which includes Parts, Wedges, Unions, etc.) before changing the colour, otherwise it will error when it comes across an object that doesn't have a Color property. In this example, the for loop will allow you to iterate through the model's descendants, and each iteration the object can be referred to as the variable Part (defined in the loop).
local model = workspace.FerrisWheelLights2
local color = Color3.fromRGB (0, 255, 0)
local descendants = model:GetDescendants()
for _,Part in pairs(descendants) do
if Part:IsA("BasePart") then
Part.Color = color
end
end
Basically, GetDescendants() returns a table of every object inside the model, including children of children and so on, while GetChildren() only gives you the direct children of the model (and not the children of those children).
Hope this helps!
2 comments
Color3 takes a value between 0 and 1 (you're not even using the colour he wants either), and you have to check if each child is a BasePart otherwise it may error. Also, you may want to explain how the loop works too.
Thanks for the tip. I realized that after I posted it. @mattscy