Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Help with text taking forever to fade out?

playbutton.MouseButton1Down:connect(function()
	for _, v in pairs(introframe:GetChildren()) do
		v:TweenPosition(UDim2.new(v.Position.X.Scale,v.Position.X.Offset + 40,v.Position.Y.Scale,v.Position.Y.Offset), "Out", "Quad", 1, true)
		for i = 0, 1, 0.1 do
			v.TextTransparency = i
			v.Shadow.TextTransparency = i
			wait()		
		end
	end
end)

I have 4 TextLabels inside the IntroFrame. It only does one at a time, and it takes a while for them to happen. How can I speed this is up, and make them all fade out at the same time?

1 comment

0

Your using an in pairs loop so all the stuff in introFrame will fade but one at a time because its a loop and it does it one at a time, if you want to do it each then you need to mabye use a coroutine or a different script to do it at once.

1 answer

That's because you fade each UI serperately. Instead, you'd want to do this:



playbutton.MouseButton1Down:connect(function()
    for _, v in pairs(introframe:GetChildren()) do
        v:TweenPosition(UDim2.new(v.Position.X.Scale,v.Position.X.Offset + 40,v.Position.Y.Scale,v.Position.Y.Offset), "Out", "Quad", 1, true)
    end

    for i = 0, 1, 0.1 do
        for _, v in pairs(introframe:GetChildren()) do
            v.TextTransparency = i
            v.Shadow.TextTransparency = i
        end
        wait()      
    end
end)

And regards the comment on the question, you definitely don't want to use serperate threads and scripts. Will make it much harder to manage.

1 comment

0

I don't see much of a difference, this may work but can you explain it to me?

This discussion is preserved as it was. New answers, comments, and votes are closed.