I'm trying to write a colour changing script that finds every brick if they have "Part" inside their name (Part1, Part2, etc) in workspace. If found then the script will change the bricks' colour to hot pink and then bright red. But the script only work if the bricks each have a different name...
local part = Workspace:FindFirstChild("Part")
while true do
if part then
part.BrickColor = BrickColor.new("Hot pink")
wait(0.5)
part.BrickColor = BrickColor.new("Bright red")
end
end
Does anyone know a function that will work for two or more bricks with the same name? Thanks

3 comments
It doesn't work exactly like how I wanted it to, but similar. Thanks!
How can I make the bricks change colour at the same time if they have the same name?
Check my edit, but be careful because if you have ALOT parts in you're place you may experience a little lag.