Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do l loop a TweenPosition?

Asked by
Probix 80
8 years ago
Edited 8 years ago

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

But...

01function ZipOnThrough()    
02    while true or false do     
03            script.Parent:TweenPosition(UDim2.new(0, 893,0, 0), "Out", "Quad", 4, true)
04                wait(4)
05            script.Parent:TweenPosition(UDim2.new(0, 0,0, 0), "In", "Quad", 4, true)
06    end
07        end
08 
09 
10script.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.

0
You did not add a wait() after the second tweenposition. The second one did not have time to complete. CodeSponge 125 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago
1function ZipOnThrough()   
2    while wait(4) do    
3         script.Parent:TweenPosition(UDim2.new(0, 893,0, 0), "Out", "Quad", 4, true)
4        wait(4)
5        script.Parent:TweenPosition(UDim2.new(0, 0,0, 0), "In", "Quad", 4, true)
6         end
7    end
8script.Parent.MouseButton1Click:connect(ZipOnThrough)
0
Thank you very much! Probix 80 — 8y
Ad

Answer this question