I understand debounce, but I want to know if I'm using it right. I'm making a toggleable FOV slider for my flight simulator game, and I want to have a little button toggling it from the side. Currently, only closing it works. Help?
local debounce = false
local button = script.Parent
local frame = script.Parent.Parent
script.Parent.MouseButton1Up:Connect(function()
if debounce == false then
--tween the gui in
debounce = true
frame:TweenPosition(
UDim2.new(1.062,-60,1,-210),
"In",
"Sine",
0.4,
false
)
button.Text = "<"
end
if debounce == true then
debounce = false
frame:TweenPosition(
UDim2.new(1,-60,1,-210),
"In",
"Sine",
0.4,
false
)
button.Text = ">"
end
end)
Any help would be appreciated.

2 comments
Hi! Thanks for answering, although it is clear that this answer could be improved. Since I don't want to make another answer and possibly "steal" your reputation, could you please change the following things?
"if not debounce then" instead of "if debounce == false" and "elseif debounce then" instead of "elseif debounce == true"