local debounce = false
function attack_A1(inputObject, gameProcessedEvent)
if inputObject.UserInputType == Enum.UserInputType.MouseButton1
and debounce == false then
debounce = true
if not gameProcessedEvent
and equipWandFrame.Visible == true then
local mouse = player:GetMouse()
local mousehit = mouse.Hit.p
local cast = game.ReplicatedStorage.Gui.cast
local spell = playerData.DATA_SpellEquipped
cast:FireServer(spell.Value, mousehit)
end
end
wait(2)
debounce = false
end
game:GetService("UserInputService").InputBegan:connect(attack_A1)
This is the portion of the script I am having trouble with, basically, what it does is, when a player clicks, it sends off certain data to the ServerScript, and then the ServerScript takes the wheel from there, anyway- I join a test server and I begin to click rapidly, to test and see if it works, correctly, and it doesn't, somehow the rapid firing of the mouse click breaks the debounce, and then there is no cooldown for the projectile.. Why is the debounce breaking?

2 comments
"debounce = true"
Your point being?