How do I set the property of a part by it's number in order or using for loops?

The issue is. I don’t know how to do the coding of finding a first number to the last number.

The example would be:

Part1
Part2
Part3


-- Every 3 seconds. Part transparency will be set to 1 from Part1 to Part3 

Like an alphabetical order from A-Z.

So, if anyone could teach me or giving advice on how to do this kind of functions. I’d be appreciate.

1 Like

Try this.

local Parts = {
    0.2, -- Part1
    0.5, -- Part2
    1, -- Part3
}

for i, v in ipairs(Parts) do
  task.wait(3)
  YourPart.Transparency = v
end

I haven’t tested this out, so it’s not guaranteed that this will work.

1 Like