I have this:
for i,v in pairs (text) do for i = 1,40 do wait() if (v:IsA("Frame")) then v.BackgroundTransparency = v.BackgroundTransparency + 1/40 elseif (v:IsA("TextLabel")) then v.TextTransparency = v.TextTransparency + 1/40 end end end
This makes the objects fade one at a time, but I want all of the objects to fade at the same time.
How would I go about doing this?
Nice attempt at your code. The solution is very simple. Your current code starts off with the generic for loop, which iterates through all descendants of the specified table, performing an action for each item there. You have the numeric for loop INSIDE of the generic, however, it needs to be OUTSIDE of it for all Frames to change at the same time.
for i = 1,40 do for _,v in pairs (text) do -- I had to change the index, which you set to "i", as it would interfere with the numeric for loop. wait() if (v:IsA("Frame")) then v.BackgroundTransparency = v.BackgroundTransparency + 1/40 elseif (v:IsA("TextLabel")) then v.TextTransparency = v.TextTransparency + 1/40 end end end