How to make this code clean

Hello!

I was playing with Animated TextLabels and wanted to animate ALL textlabels at the same time for few times (in for loop)
without leaving the for loop

Here is the code:

		for	r = 1, 5, 1 do
			local DisplayText1 = TweenService:Create(TextLabel1, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {MaxVisibleGraphemes = #TextLabel1.Text})
			local DisplayText2  = TweenService:Create(TextLabel2, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {MaxVisibleGraphemes = #TextLabel2.Text})
			local DisplayText3 = TweenService:Create(TextLabel3, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {MaxVisibleGraphemes = #TextLabel3.Text})
			DisplayText1:Play()
			DisplayText2:Play()
			DisplayText3:Play()
			
			DisplaySoundName.Completed:Wait()
		end

        -- Rest of code after for loop ends and all text were animated fully for 5 times.

I was trying with (custom) function that I called AnimateText but problem was that each text label was animated after other one.

If you want it cleaner, then I would suggest an additional for loop. While it is not “really needed” whenever you got only 3 textlabels, it could be beneficial if you had more.

		for	r = 1, 5, 1 do
			local tweens = {}
			tweens[1] = TweenService:Create(TextLabel1, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {MaxVisibleGraphemes = #TextLabel1.Text})
			tweens[2] = TweenService:Create(TextLabel2, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {MaxVisibleGraphemes = #TextLabel2.Text})
			tweens[3] = TweenService:Create(TextLabel3, TweenInfo.new(0.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {MaxVisibleGraphemes = #TextLabel3.Text})
			for _, tween in Table do
				tween:Play()
			end
			DisplaySoundName.Completed:Wait()
		end

Also if all the tween info is the same, I would suggest making a variable outside your function with those informations, so the script can just reference that.