When I press the TextButton it keeps printing out "opened" and "closed"
It also only allows me to open it, and the text of the text button does not change either.
local button = script.Parent -- the text button you have to press to reposition the frame
local frame = script.Parent.Parent -- the frame that I wish to move
local isopen = false
repeat wait() until button
button.MouseButton1Down:connect(function()
if isopen == false then
button.Text = "<" -- make the button text that you press change
frame:TweenPosition(UDim2.new(0, 0, .3, 0), 1, "Bounce", .5) -- "opening"
isopen = true -- make open == true since the gui has moved positions
print("opened")
end
if isopen == true then
button.Text = ">" -- make the button text that you pressed change
frame:TweenPosition(UDim2.new(0, -220, .3, 0), 1, "Bounce", .5) -- closing
isopen = false -- make open == false because the gui is now out of the screen
print("closed")
end
end)
