what am i trying to accomplish? simple, a combo reset for my combat
what is the problem? the variable count, which is a number is not increasing and is staying 0 even when i increase it
the code:
local uis = game:GetService("UserInputService")
local mouse = game.Players.LocalPlayer:GetMouse()
local combat = script:WaitForChild("RemoteEvent",3)
local stat = game.Players.LocalPlayer:WaitForChild("Player_Stats",3)
local character = game.Players.LocalPlayer.Character
local debounce = false
local currTime = 0
local prevTime = 0
local cd = .6
local count = 0
uis.InputBegan:Connect(function(input,isTyping)
if isTyping then
return
else
if input.UserInputType == Enum.UserInputType.MouseButton1 then
if character["Right Arm"]:FindFirstChild(stat.Weapon.Value) or character:FindFirstChild("WeaponEquipped") then return end
if debounce == false then
debounce = true
currTime = tick()
local passedTime = currTime - prevTime
if passedTime < 1 then
count = count + 1
print(count)
if count > 5 then
count = 0
end
else
count = 0
end
if count > 0 then
combat:FireServer(count,mouse.Hit.Position)
else
print("Count is 0")
end
end
end
end
end)
combat.OnClientEvent:Connect(function()
wait(cd)
debounce = false
end)