There are many ways to change multiple part colors.
I will show & explain a few ways. Also, because you are changing a color w/ a GUI, you make your question a bit confusing to if you want it for just a GUI, or if you're trying to change it in-game.
A not so efficient way could be naming each part and doing game.Workspace.Part100.BrickColor = BrickColor.new("Black")
and take forever to write your code.
Another way can be using the GetChildren()
method in a Generic loop
. You could just model all the parts together (That you want to have a color change) for it to be easier. Example:
1 | local Model = game.Workspace.PartCollection |
2 | local Parts = Model:GetChildren() |
5 | for _, Part in pairs (Parts) do |
6 | Children.BrickColor = BrickColor.new( "Really red" ) |
- You can use a Table, but you'll end up (Maybe) using a Generic for loop to change them and the above way is much simpler. Of course you could possibly do more things with a Table!
If this helps, help me with an Up Vote and Accept!