Ok so I know this may sound like a dumb question but I have parts with the same name that I want to paint all at the same time on button press because renaming all of the parts can be tiresome and will create a longer script, I've come up with a script but it only works for one part of course because there are many of the same parts named "Wall," I've looked at scripts for calling all of the parts at the same time but I can't figure out how to do it, can anybody demonstrate on my script below?
Button = script.Parent
function OnButtonClick()
game.workspace.Wall.BrickColor = BrickColor.new(192)
end
script.Parent.MouseButton1Down:connect(OnButtonClick)

2 comments
Thank you! Does this work with a function OnButtonClick() because I just tried to add it to my code and it didn't work
I think it's better practice to usually use pairs, and i,v if you are not 100% sure what the objects are