im creating a m1 combo system but I can never continue the combo when I click
local rp = game:GetService("ReplicatedStorage")
local Combat = rp:WaitForChild("Combat")
local UIS = game:GetService("UserInputService")
local debounce = false
local cd = .25
local currTime = 0
local prevTime = 0
local count = 0
UIS.InputBegan:Connect(function(input,isTyping)
if isTyping then
return
elseif input.UserInputType == Enum.UserInputType.MouseButton1 then
if debounce == false then
-- debounce = true
currTime = tick()
local passedTime = currTime - prevTime
if passedTime < 1 then
print("continue combo")
count = count + 1
if count > 5 then
count = 1
end
else
print("reset m1 combo")
count = 1
end
Combat:FireServer(count)
print(count)
end
end
end)
Even if I click fast enough it will reset the combo