Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you change multiple bricks color in a model?

Asked by 8 years ago

Do you have to do them separately?

I'm making a hologram game.

When the orange button has been pressed, it lights up the other brick so you can walk to the other side of the map.

0
(I'm horrible at explaining, sorry :P) seansomebody 5 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

Not exactly sure what you're asking, but based on the title you provided, it should look something like this:

newColor = BrickColor.new("Really red");

model = game.Workspace.MyModel;

for i, v in ipairs(model:GetChildren()) do
    if(v:IsA("Part") or v:IsA("BasePart")) then
        v.BrickColor = newColor;
    end
end
2
Switch :IsA("Part") to :IsA("BasePart") BaseParts include parts, wedges, unions and the others YellowoTide 1992 — 8y
0
Thanks, I had forgot about BaseParts. ProtectedMethod 105 — 8y
Ad

Answer this question