The script below makes a gui go from left to right. So I make this gui start from the right side of the screen and it goes to the left. Whenever it goes to the left, the gui just disappears. I want whenever it disappears from the left side of the screen, I want it to appear back on the right side of the screen and repeat.
while true do script.Parent.Position=script.Parent.Position-UDim2.new(0.005,0,0,0)-- "-" makes it go from right to left wait() end
Updated
Try this:
Startposition=script.Parent.Position while true do local RightBorder=script.Parent.AbsolutePosition.X+script.Parent.AbsoluteSize.X if RightBorder<=0 then script.Parent.Position=Startposition else script.Parent.Position=script.Parent.Position-UDim2.new(0.005,0,0,0) end wait() end
Anyways, this should work correctly now. If not, or if you have any further questions, please leave a comment below. Hope I helped :P
You didnt use TweenPosition!
(note pick a position to start at(no script) then pick where you want it to move)
while true do script.Parent:TweenPosition(UDim2.new(number, number, number, number), "Out", "Quad", number, true or false) -- quad and out are just the default or something like that wait(number) script.Parent:TweenPosition(UDim2.new(original pos., original pos., original pos., original pos.), "Out", "Quad", number, true or false) end
For more info visit this http://wiki.roblox.com/index.php?title=TweenPosition