As the Title says, How do i loop Something. I’m trying to Make it so the Title would move up and down. Here is a example code:
local Title = script.Parent.Parent
--What do i put here?
Title:TweenPosition(UDim2.fromScale(0.173,0),Enum.EasingDirection.In,Enum.EasingStyle.Sine, 0.4)
wait(0.4)
Title:TweenPosition(UDim2.fromScale(0.173,-0.1),Enum.EasingDirection.In,Enum.EasingStyle.Sine, 0.4)
--Do I put End here?
local Title = script.Parent.Parent
while true do -- need to be true in order to loop
Title:TweenPosition(UDim2.fromScale(0.173,0),Enum.EasingDirection.In,Enum.EasingStyle.Sine, 0.4)
wait(0.4)
Title:TweenPosition(UDim2.fromScale(0.173,-0.1),Enum.EasingDirection.In,Enum.EasingStyle.Sine, 0.4)
wait(0.4)
end
You can put it in a while true do loop. You also have to add a wait after your second tween.
New code:
--//Variables
local Title = script.Parent.Parent
--//Loops
while task.wait(0.4) do
Title:TweenPosition(UDim2.fromScale(0.173, 0), Enum.EasingDirection.In, Enum.EasingStyle.Sine, 0.4)
task.wait(0.4)
Title:TweenPosition(UDim2.fromScale(0.173, -0.1), Enum.EasingDirection.In, Enum.EasingStyle.Sine, 0.4)
end
oh right. common mistake on my end. thanks for correcting! also why would they have both wait and task.wait then? wouldn’t everyone be using task.wait if they knew that?