Problem with changing models inside of models

I was building a cabin the other day and wanted to change the BrickColor to reddish brown however i couldn’t seem to get the models i placed inside my main models to do what i wanted them to. They all had the same name. This is the code:

for i, v in pairs (game.workspace.RightWall:GetChildren())
If:IsA ( "Part") then
         if Part.Name == "Part" then
            local MyPart = game.workspace.Part
            MyPart.BrickColor= BrickColor.new "Reddish Brown"
            MyPart.Material = "Wood"
            MyPart.Anchored = true
    end
end

I am on mobile so excuse the how bad the code looks.

1 Like

Is there any other block overwriting the main block? For example if there is 2 blocks named Part, the one you don’t want to change is overwriting it.

1 Like

Oh that must be the problem. I had parts named Part that werent inside that same model. Thanks for the help.:grinning: