So, I used a script:
function color()
Game.Workspace.Part.BrickColor = BrickColor.new("Really red")
end
script.Parent.MouseButton1Down:connect(color)
But I want a more simple way to change more other than cloning it and changing the part names.
So, I used a script:
function color()
Game.Workspace.Part.BrickColor = BrickColor.new("Really red")
end
script.Parent.MouseButton1Down:connect(color)
But I want a more simple way to change more other than cloning it and changing the part names.
To change a part colour, this is the best way
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:
local Model = game.Workspace.PartCollection
local Parts = Model:GetChildren()
for _, Part in pairs(Parts) do
Children.BrickColor = BrickColor.new("Really red")
end
If this helps, help me with an Up Vote and Accept!
I said "Part100" as a joke because that would be the 100'th part due to their being so many you'll have to put down
Your second variable in the for loop, Children, doesn't really make sense since it doesn't equal anything plural -- you're only accessing one child at a time. 'child', 'part', 'brick' or other singular words would make more sense.
Edited for you
Would I put this in the TextBox? Because I dont know what to edit so I can have it click.
Did I mention I'm horrible at scripting? XD
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
Oh, to do it for more than one part? Use a :GetChildren() or a table.
How would I use GetChildren? (I am horrible at scripting! xD)
Do the parts you want to change all have the same parent?