Where do I move the debounce lines? The debounce is not working.
local debounce = true
local number = 1
function onMouseButton1Click()
if debounce == false then return end
for i=0, 1, 0.03125 do
if number == 1 then
script.Parent.TextButton.BackgroundTransparency = i
script.Parent.TextButton.TextTransparency = i
script.Parent.TextLabel.TextTransparency = i
wait(0.03125)
debounce = true
elseif number == 2 then
script.Parent:Destroy()
elseif number == 3 then
number = 0
end
end
number = number + 1
end
script.Parent.TextButton.MouseButton1Click:connect(onMouseButton1Click)
Thanks!

1 comment
I updated my answer. It should work for you now :)