Gui TweenPosition help

I’m very new to Gui TweenPosition but I understand how it works, so I’m trying to make the text move down, I’ve re-written the script about 3 times but I do not manage to make it work.
The 1st text is moving up and the 2nd is not going fully down.

This is the script that I made

script.Parent[1]:TweenPosition(UDim2.new({0, 0},{-1, 0}))
script.Parent[2]:TweenPosition(UDim2.new({0, 0},{-1, 0}))
script.Parent.Parent.Frame.Frame2:TweenPosition(UDim2.new({0, 4},{0.4, 4})) 
script.Parent.Parent.Frame.Frame1:TweenPosition(UDim2.new({0, 0},{0.4, 0}))
wait(4)
script.Parent.Parent.Frame.Frame2:TweenPosition(UDim2.new({0, 0},{1, 0})) 
script.Parent.Parent.Frame.Frame1:TweenPosition(UDim2.new({0, 0},{1, 0}))
script.Parent:TweenPosition(UDim2.new(-1,0,0,0))

Results

These references aren’t too clear, is Frame2 te “SCP-087…” one, and Frame1 the “Loading…” one?
If so, here’s a cleaner way to attempt what I think you’re after:

--define references to frame1, frame2
local frame1 = script.Parent.Parent.Frame.Frame1
local frame2 = script.Parent.Parent.Frame.Frame2

--make UDim2's to represent on/off-screen
local onScreen = UDim2.new(0, 0, 0.4, 0)
local offScreen = UDim2.new(0, 0, -1, 0)

--make both off-screen
frame1.Position = offScreen
frame2.Position = offScreen

--tween frame1 on-screen
frame1:TweenPosition(onScreen)
--wait 4 seconds
task.wait(4)
--tween frame1 off-screen, frame2 on-screen
frame1:TweenPosition(offScreen)
frame2:TweenPosition(onScreen)

Without seeing more about the properties of the two frames I can’t fully replicate this on my end to see if the result is what you expect.

1 Like