I'm making a main menu that has a lot of tweens. How can I make this neater if possible? There's a lot of repetitions and I thought about the "don't repeat yourself" rule. I think you can use tables but I don't know how to use them in this situation. Here's my script:
local tween1 = TS:Create(frame.Frame.UIGradient,tweenInfo,properties1)
local tween2 = TS:Create(frame.Frame.TextButton1.TextLabel,tweenInfo2,properties2)
local tween3 = TS:Create(frame.Frame.TextButton2.TextLabel,tweenInfo2,properties2)
local tween4 = TS:Create(frame.Frame.TextButton3.TextLabel,tweenInfo2,properties2)
local tween5 = TS:Create(frame.Frame.TextButton4.TextLabel,tweenInfo2,properties2)
frame.Changed:Connect(function(property)
if not property == "Visible" then
return
end
wait(1)
tween1:Play()
tween1.Completed:Wait()
tween2:Play()
tween2.Completed:Wait()
tween3:Play()
tween3.Completed:Wait()
tween4:Play()
tween4.Completed:Wait()
tween5:Play()
tween5.Completed:Wait()
end)

2 comments
you can do all this in 1 line but it would look odd like this: local tween1,tween2,tween3,tween4,tween5 = (put all your tweens here)
Ima play around with the code and see if I can get a function going that just needs a few inputs, ill respond with an answer If I get it.