I have a combat system that is meant to only do 4 hits and then wait 1.25 seconds. For some reason, it does a 5th one that acts as the 4th hit and doesn’t print to the console. Any help?
uis.InputBegan:Connect(function(input, a)
if a then return end
if input.UserInputType == Enum.UserInputType.MouseButton1 then
if db then return end
db = true
--[[if tick() - lastHit > 1.25 then
count = 0
end--]]
if count < 4 then
count += 1
print(count)
remote:FireServer(hitbox(), count, root.CFrame.lookVector)
lastHit = tick()
task.wait(dbTimeA)
if tick() - lastHit > dbTimeA then
db = false
end
else
remote:FireServer(hitbox(), count, root.CFrame.lookVector)
lastHit = tick()
count = 0
task.wait(dbTimeB)
db = false
end
end
end)```