I'm making a help gui for new players, and I want a system where if you click the button that shows the help screen again after clicking it once already, it will stop showing it. This system isn't working and I don't know why. It does tween it back to it's original position when you click it again. But then if you try to click it a third time, nothing happens. Here's my code
local AlreadyClicked = false
script.Parent.MouseButton1Down:Connect(function()
local HelpGUI = script.Parent.Parent.HelpGUI
if AlreadyClicked == true then
AlreadyClicked = false
HelpGUI:TweenPosition(UDim2.new(-0.179, 0,0.306, 0),"Out","Quad",1,false)
end
HelpGUI:TweenPosition(
UDim2.new(0.101, 0,0.309, 0),
"Out",
"Quad",
1,
false)
AlreadyClicked = true
end)

1 comment
Do you mind explaining why that works? It does works but I have no idea why.