I am wanting to do a loop of changing parts color without having to write each part out.
Such as, I have 5 bricks in workspace. I want to change them all with the loop. How would I go about this?
Example (script in workspace)
local part = script.Parent
x = 1
while x =< 5 do
part[x].Color = Color.new(0,255,0)
wait(2)
x +=1
end
Don't know what this way is called.

7 comments
I tried this and keep getting an error. It's saying that the part doesn't exist. I check capitalization and location, though every looks right.
Okay so I am assuming that the part's names are not numbers....try changing "local part = script.Parent" to "local part = script.Parent:GetChildren()"
They are numbers, my parts are named Part1, Part2 ... Part 5. Could this be messing up because I am trying to call them from a group? As in, the parts are grouped together in workspace (trying to make a 'click to build and watch it being built').
OH. Okay. Then change line 12 in my script to "part["Part"..x]. It looks for a child called "Part1", "Part2", "Part3", etc etc from combining the number x with "Part"
Actually, nevermind. Found the problem was I still had ":GetChildren()". Thank you for the help!
One last thing, how do I set this question into 'answered'?
It should be at the bottom of my question and comments, something along the lines of "Accept Answer"