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

How do l loop a TweenPosition?

I learned how to use TweenPosition and I decided I wanted my Gui to loop infinitely.

But...

function ZipOnThrough()	 	
	while true or false do		
			script.Parent:TweenPosition(UDim2.new(0, 893,0, 0), "Out", "Quad", 4, true)
				wait(4)
			script.Parent:TweenPosition(UDim2.new(0, 0,0, 0), "In", "Quad", 4, true)
	end
		end
	

script.Parent.MouseButton1Click:connect(ZipOnThrough)

It doesn't work. It would just go to the coordinates "0, 893,0, 0" but then it would just stop. I would really appreciate the help.

1 comment

0

You did not add a wait() after the second tweenposition. The second one did not have time to complete.

1 answer

✓ Accepted answer
function ZipOnThrough()    
	while wait(4) do     
		 script.Parent:TweenPosition(UDim2.new(0, 893,0, 0), "Out", "Quad", 4, true)
		wait(4)
		script.Parent:TweenPosition(UDim2.new(0, 0,0, 0), "In", "Quad", 4, true)
		 end
	end
script.Parent.MouseButton1Click:connect(ZipOnThrough)

1 comment

0

Thank you very much!

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