script.Parent.AutoButtonColor = false
plr = game.Players.LocalPlayer
menu = plr.PlayerGui.Menu.ScrollingFrame
debounce = false
function onClick()
debounce = true
if menu.Position == UDim2.new(0,0,0,0) then
for i = 1,10 do
wait()
menu.Position = menu.Position - UDim2.new(.03,0,0,0)
end
script.Parent.Text = "Open"
else
wait()
for i = 1,10 do
wait()
menu.Position = menu.Position + UDim2.new(.03,0,0,0)
end
script.Parent.Text = "Close"
end
debounce = false
end
script.Parent.MouseButton1Click:connect(onClick)
it works the first two times you click it, but after that, does the second for loop when it's supposed to do the first for loop.

1 comment
nvm I fixed it.