It tweens the first time, but not the second.
local frame = script.Parent.Parent.Settings local button = script.Parent local ting = true local open = false function Click() if ting == true and open == false then ting = false frame:TweenPosition((UDim2.new(0, 0, 0, -50)),"Out", "Bounce", 1) open = true end if ting == false and open == true then ting = true frame:TweenPosition((UDim2.new(0, 3000, 0, -50)),"Out", "Bounce", 1) frame.Position = UDim2.new(0, -900, 0, -50) open = false end end button.MouseButton1Down:connect(Click)
The problem here is that you are attempting to move the Frame twice at once.
Try editing your code to add an elseif
, rather than a 2nd if
statement.
local frame = script.Parent.Parent.Settings local button = script.Parent local ting = true local open = false function Click() if ting == true and open == false then ting = false frame:TweenPosition((UDim2.new(0, 0, 0, -50)),"Out", "Bounce", 1) open = true elseif ting == false and open == true then ting = true frame:TweenPosition((UDim2.new(0, 3000, 0, -50)),"Out", "Bounce", 1) frame.Position = UDim2.new(0, -900, 0, -50) open = false end end button.MouseButton1Down:connect(Click)