I’m trying to create a little announcement script, and I’m trying to Tween the announcement GUI when a button is clicked. I’ve looked through quite a few tutorials and attempted to modify my script to them, but am unable to find anything that contradicts my code.
local ann = game.StarterGui.StaffPanel.Announcement
script.Parent.MouseButton1Click:Connect(function()
print("STARTED TWEEN")
ann:TweenPosition(UDim2.new(0.301, 0,0.017, 0),Enum.EasingDirection.In, Enum.EasingStyle.Sine, 0.6, true)
print("GOT TO SECOND TWEEN - WAITING")
wait(10)
ann:TweenPosition(
ann:TweenPosition(UDim2.new(0.301, 0,-0.124, 0),Enum.EasingDirection.In, Enum.EasingStyle.Sine, 0.6, true)
)
end)
As you can see, after the first Tween I set a message to be printed out. The second I hit the button that is meant to begin the tweeing process, booth the “STARTED TWEEN” and “GOT TO SECOND TWEEN - WAITING” are printed at the same time.
Anyone have any idea how this is to be fixed/achieved?
If you don’t mind, how would that be done? I don’t really deal in Tweens and the devforum post only really focuses on how two conflicting parts would be tweened.