aeriscu
(myles)
October 17, 2020, 2:39pm
#1
Hello, it’s me again!
Alrighty, let me explain what is my problem is and what I’m trying to do.
So, I’m making a “News & Update” GUI and I want it to cycle between two things.
reference image
I want to tween to the right after 10 seconds, wait 2 seconds and then the second one will tween on back off after 10 seconds and then 1st one is back and it repeats.
Here is my script so far, any help is appreciated:
script
local news = script.Parent.News1
local news2 = script.Parent.News2
wait(10)
news:TweenPosition(UDim2.new(0.998, 0, 0.013, 0), "InOut", "Sine", 0.7)
wait(2)
news2:TweenPosition(UDim2.new(0, 0, -0.004, 0), "InOut", "Sine", 0.7)
wait(10)
news2:TweenPosition(UDim2.new(0.998, 0, 0.013, 0), "InOut", "Sine", 0.7)
wait(2)
news:TweenPosition(UDim2.new(0, 0, -0.004, 0), "InOut", "Sine", 0.7)
Where the script is placed
I also want to double check, that the script should work here.
me_isidoit
(me_isidoit)
October 17, 2020, 2:42pm
#2
Where’s the problem exactly? What part of the script doesn’t work?
1 Like
aeriscu
(myles)
October 17, 2020, 2:44pm
#3
I want to know how to make it repeat.
I’m not the smartest, sorry if I’ve made no sense.
You can have a while loop to have it repeat.
1 Like
me_isidoit
(me_isidoit)
October 17, 2020, 2:45pm
#5
Repeat the whole process?
You can use for
loop for that, to repeat it twice (not sure if you meant this tho)
local news = script.Parent.News1
local news2 = script.Parent.News2
for i = 1,2 do
wait(10)
news:TweenPosition(UDim2.new(0.998, 0, 0.013, 0), "InOut", "Sine", 0.7)
wait(2)
news2:TweenPosition(UDim2.new(0, 0, -0.004, 0), "InOut", "Sine", 0.7)
wait(10)
news2:TweenPosition(UDim2.new(0.998, 0, 0.013, 0), "InOut", "Sine", 0.7)
wait(2)
news:TweenPosition(UDim2.new(0, 0, -0.004, 0), "InOut", "Sine", 0.7)
end;
Alternatively, you can use while
loops to repeat it infinitely as @COUNTYL1MITS suggested.
1 Like
aeriscu
(myles)
October 17, 2020, 2:51pm
#6
Thanks, this was extreamly helpful!
I will try out the while
loops too, but thanks your addition helps a bunch!
1 Like