basically my script is like this (Keep in mind some parts of this have been shortened or modified for ease of understanding):
debug = false firing = false
IfTheGUIHasMouseDown(function() if debug = true then return end debug = true firing = true while firing = true do if Ammo ~= 0 then fire() wait(0.1) firing = false end end end)
IfTheMouseIsLiftedFromGUI(function() firing = false if debug = true then wait(0.1) debug = false end end)
======= My issue here is that I need to prevent the gun from having double fire. The debug works if you double click the GUI slowly, but if you're fast enough the debug simply doesn't work. From my understanding when MouseButton1 is lifted debug shouldn't become false for another 0.1 seconds, but that doesn't happen. Help?

1 comment
It would help if you posted the actual script so I could explain why it's wrong.