local credits = false local SG = script.Parent.Parent.Parent local debounce = false script.Parent.MouseButton1Click:connect(function () if credits == false and debounce == false then credits = true debounce = true end if credits == true and debounce == false then credits = false debounce = true end if credits == true and debounce == true then SG.Credits.Visible = true for i = 1, 14 do SG.Credits.Position = SG.Credits.Position + UDim2.new(0.05,0,0,0) wait(0) if i == 14 then script.Parent.Text = "Close Credits" debounce = false end end end if credits == false and debounce == true then for i = 1, 14 do SG.Credits.Position = SG.Credits.Position - UDim2.new(0.05,0,0,0) wait(0) if i == 14 then script.Parent.Text = "Credits" SG.Credits.Visible = false debounce = false end end end end)
So, the debounce here is to avoid that people that clicks a milion a times per second to open something and bugs the gui, right? Well im using debounce, but when i click alot of times on the button, the gui bugs. Whats the problem?
Your script isn't wrong, it's running exactly how you told it to run.