Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Gui not tweening?

Asked by 9 years ago

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)
0
Try adding wait(1) after line14 ultimate055 150 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

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)

Ad

Answer this question