There is more than one solution for this post. Thank you to everyone.
when i do the for i = 0,1,.1 do loop it does one part at a time. how would i make it so that it does all the parts at once but there is a wait added to the increment?
The script below is before the solution where only one part would change transparency at a time.
local folder = game.Workspace.Folder
for i, v in pairs(folder:GetChildren()) do
if v:isA("Part") then
for i = 0, 1, .2 do
v.Transparency = i
wait(.5)
end
end
end
local folder = game.Workspace.Folder
for i = 0, 1, .2 do
for i, v in pairs(folder:GetChildren()) do
if v:isA("Part") then
v.Transparency = i
end
end
wait(.5)
end
local folder = game.Workspace.Folder
for i = 0, 1, .2 do
for _, v in pairs(folder:GetChildren()) do
if v:isA("BasePart") then
v.Transparency = i
end
end
wait(.5)
end
local folder = game.Workspace.Folder
for i, v in pairs(folder:GetChildren()) do
if v:isA("BasePart") then
coroutine.wrap(function()
for i = 0, 1, .2 do
v.Transparency = i
wait(.5)
end
end)()
end
end
i actually ended up using this before i saw your post. but it tis the answer. here’s another way i did it as well is writing the for i = 0,1,.2 before the for i, v in pairs() but you can’t name i for both for loops or it won’t work. need to name them differently.
you are right. i for the coroutine wrap works. but i’m probably just going to call it different anyways. the other method is where i for both for loops broke the script