The ability to more neatly fade in transparency in rows

My script right now is

wait(5) --this number changes depending on row

while script.Parent.Transparency > 0 do
	wait (0.01)
	script.Parent.Transparency -= 0.01
end

print("fixing")

if script.Parent.Transparency < 0 then
	script.Parent.Transparency = 0
end

I realize that I have to copy this script into every row of block in order to make a fading in effect with rows (in this example there are 39 studs worth of rows.)

So my main question is: How do I combine 39 scripts into one so I don’t have to keep copying, pasting, editing scripts… or basically any way to cut down on the amount of scripts.

I’m basically trying to create this
ezgif.com-gif-maker Obviously I can fix the bad appearance fade myself

Yeah and sorry if this is bad I never used Devforum in a really long time

1 Like

You can try a for loop with this

Simple answer: ModuleScript | Roblox Creator Documentation !

Another thing you can do with this is use a Folder or Model and use :GetChildren() to get all the bricks inside of it, this would return a table with each brick inside, then you could loop through the table to start fading each brick.

Another way instead of Folder and Models, you can use CollectionService | Roblox Creator Documentation to tag instances and then get the tagged parts as a table, and again, loop through it.

first of all, use tween service for the transparency, put all of the parts in a folder, use GetChildren() to get all of the parts