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

Can someone help me with this?

Asked by 10 years ago

So, I have this script that can change the color of my model. The thing I do not like is that it changes the color of my entire model, and I do not want that. I am confused because the "Children" of the model "Item" inside the model "Model" are named Parts, and that is their class name as well. I do not understand where "BasePart" is coming from, if the model does not have anything named "BasePart." Can someone help me?

if Model:FindFirstChild("CurrentColor") ~= nil then
                local CurrentColor = Model.CurrentColor.Value
                print("Found color")
                for i,v in pairs(Model.Item:GetChildren()) do
                    if v:IsA("BasePart") and v.BrickColor.Name == CurrentColor.Name then
                        v.BrickColor = BrickColor.new(Color)

                    end

1 answer

Log in to vote
0
Answered by 10 years ago

BasePart is another class name of Part. Also, what are some bricks that you want the color to change into?

0
Is there a way I can change the name of some of the bricks to Color, to make just those specific bricks change color? PresidentAlvarez 5 — 10y
Ad

Answer this question