Alright, Hello everyone so I was just learning GUI tweening, And I wanted to make something with it, so i basically just made a simple button that opens a frame, and added a tween to it.
So Basically the Tween worked Once you click the button, but Once I click the button once and then close the Frame, the tween doesnt work again.
local StartAll = script.Parent.Menu.ShowMenu.Appear
local MainMenu = script.Parent.Menu.MainMenu
StartAll.MouseButton1Click:Connect(function()
MainMenu:TweenPosition(UDim2.new(0, 0, 0.372, 0), “Out”, “Quad”, 1, true) --with true it is so that it does the function and false is so that it does not do such a function
end)
local StartAll = script.Parent.Menu.ShowMenu.Appear
local MainMenu = script.Parent.Menu.MainMenu
local open = false -- Set this to true if your frame will start off being open
local debounce = true
StartAll.MouseButton1Click:Connect(function()
if debounce then
debounce = false
if open then
open = false
MainMenu:TweenPosition(UDim2.new(put your values here), "Out")
else
open = true
MainMenu:TweenPosition(UDim2.new(put your values here), "Out")
end
debounce = true
end
end)