I am trying to make a turn by turn transparency system so it gets all the childeren in a folder and loops them and changes visibility one by one
while task.wait(1) do
for i,v in ipairs(Folder:GetChildren()) do
v.Transparency=1 --turn invisible
task.wait(1)
v.Transparency=0 --turn visible
end
end
pairs does all immediately
ipairs does all 1 by 1
This is not correct. Pairs/ipairs refers to the type of table. It’s either key: value (i.e a dictionary) or it’s index : value (i.e an array).
If this is to be a sequence you can name them.
local parts=workspace:WaitForChild("Parts") --folder
function toggleTransparency(mode)
for i=1,5 do --1 to number of them
local v=parts:FindFirstChild("Part"..string.format("%02d",i))
if v then v.Transparency=mode task.wait(1) --pause
end
end
end
toggleTransparency(1)
toggleTransparency(0)
--Part01 Part02 Part03 exc..