Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

For loops and numbered parts?

Asked by 5 years ago

So lets i have 3 parts, each are called, part1, part2, part3. Now lets say i use a for loop. Is there a way to change the part within the for loop? For example:

for i = 1,3 do
    part[i].Name = 'hello'
 end

Is there anyway to do that?

1 answer

Log in to vote
1
Answered by
xg1y 41
5 years ago
Edited 5 years ago
Parts = {
workspace.Part1,
workspace.Part2,
workspace.Part3
}

for _,v in pairs(Parts) do
-- code here eg; v.BrickColor = ()
end

I'm guessing this is what your asking?

If there's any errors just let me know, but I guess this is a decent way to do it? (If this is what your asking)

0
yes it is thank you! kevinliwu1 9 — 5y
0
The explanation? User#24403 69 — 5y
Ad

Answer this question