So I'm working on a GUI and I'm working on a little cutscene in it. I'm making textlabels change transparency within a loop. I want to trigger another loop without stopping the present one and/or change two different variables in the same loop where one counts up and the other counts down.
This is what I have now.
function onPlayerAdded()
local intro = menus.Intro
intro.Visible = true
local tew = intro["TEW"]
local presents = intro.Presents
intro.BackgroundTransparency = 0
for i = 1, 0, -0.1 do --First loop
tew.TextTransparency = i
wait(0.1)
end
for p = 1, 0, -0.1 do --Second loop
presents.TextTransparency = p
wait(0.1)
end
end
Players.PlayerAdded:Connect(onPlayerAdded)
How would I change two variables in the same loop where one goes up and the other goes down? This was my attempts at figuring it out.
--Attempt 1
for p = 1, 0, -0.1 do --Second loop
presents.TextTransparency = p
wait(0.1)
tew.TextTransparency = -p
end
--Attemp2
while tew.TextTransparency ~= 0 do
tew.TextTransparency = tew.TextTransparency - 0.1
wait(0.1)
end
if tew.TextTransparency == 0 then
while presents.TextTransparency ~= 0 do
presents.TextTransparency = presents.TextTransparency - 0.1
tew.TextTransparency = tew.TextTransparency - 0.1
wait(0.1)
end
end
I'm out of ideas from here. What should I do?

3 comments
In fact your code at line 15 will work, just change line 17 to tew.TextTransparency = tew.TextTransparency + 0.1, not sure why you didnt want to do that
I didnt think about it, I stayed up pretty late last night to finish some work. I made a few other mistakes. Maybe I shouldn't be scripting while running on midnight fuel... Thank you!
No problem man