Here is the simple script: game.Workspace.Part.BrickColor = BrickColor.new
So lets say all the bricks in Workspace are all named "Part". Why does the script only change the color of one of the Bricks ? Is this a solvable problem?
You'd be able to select all of the parts that are named Part in the workspace by iterating through all of the parts that are named Part. Here is an example:
for i,v in next, game.Workspace:GetChildren() do if v.Name == "Part" and v.ClassName == "Part" then v.BrickColor = BrickColor.new(--desired brick color in a string--) end end
I hope I helped!
To select multiple bricks, you will need to use a loop.
Just like the other guy said.
for _,Part in next, (game.Workspace:GetChildren()) do -- Gets all items in workspace if (Part .Name == "Part") and Part :IsA("BasePart") then -- Checks if the name is "Part" and if the item is actually a basepart. I prefer using ':IsA' than checking for the ClassName. Part .BrickColor = BrickColor.new("Really red") -- Random example, note: Colors are cap sensitive, you have to spell it properly end end