Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Gui not tweening?

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)

1 comment

0

Try adding wait(1) after line14

1 answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.