So I have code here, I'm trying to make a debounce thing and the following line of code doesn't work to stop somebody from firing a remote twice: if batchdebounce == 0 then What happens when I click the button twice (AFTER the value is changed to 10 too) is it fires again and does all the stuff again even though it should've jumped to line 16. My full code is below;


batchbutton.MouseButton1Click:Connect(function()
print(batchdebounce)
if batchdebounce == 0 then --> This should stop the code below if the value isn't 0 and skip to line 16, but it doesn't
RippleEffect(batchbutton, m.X, m.Y)
warn('ADM --> Starting batch...') 
revent:FireServer(donutcode)
wait(2)
warn('ADM --> Batch successfully started.') 
SG:SetCore('SendNotification',  {
Title = 'Doughnut Machine';
Text = 'Batch successfully started.';
    })

    else

RippleEffect(batchbutton, m.X, m.Y)
warn('ADM --> You need to wait nil seconds to start a new batch!') 
SG:SetCore('SendNotification',  {
Title = 'Doughnut Machine';
Text = 'You need to wait nil seconds to start a new batch!';
})
end
end)

Also another note; I changed it to 5 and clicked again when the value was 0 and it worked, but for some reason it doesn't work with 0.