im making a combat reset script and i found a solution that i understood on teh dev forum. The problem is the script wont run and im not exactly sure what the issue is.
heres the code
local Tick = RS.Stepped:Wait()
if Tick - lastAttackTick < resetTime then -- Check if they clicked within the AttackChainResetThreshold value
if count == 1 then
local check1 = event:InvokeServer({1, "Start"})
if check1 == "Proceed" then
hum.WalkSpeed = 0
hum.JumpHeight = 0
anims.M1:Play()
anims.M1:GetMarkerReachedSignal("Hit"):Connect(function()
if cd == false then
cd = true
print("no")
local check2 = event:InvokeServer({1, "M1"})
if check2 == true then
hum.WalkSpeed = 16
hum.JumpHeight = 7.2
count = 2
end
task.wait(.2)
cd = false
end
end)
end
elseif count == 2 then
local check1 = event:InvokeServer({2, "Start"})
if check1 == "Proceed" then
hum.WalkSpeed = 0
hum.JumpHeight = 0
anims.M2:Play()
anims.M2:GetMarkerReachedSignal("Hit"):Connect(function()
if cd == false then
cd = true
print("no")
local check2 = event:InvokeServer({2, "M2"})
if check2 == true then
hum.WalkSpeed = 16
hum.JumpHeight = 7.2
count = 3
end
task.wait(.2)
cd = false
end
end)
end
elseif count == 3 then
local check1 = event:InvokeServer({3, "Start"})
if check1 == "Proceed" then
hum.WalkSpeed = 0
hum.JumpHeight = 0
anims.M3:Play()
anims.M3:GetMarkerReachedSignal("Hit"):Connect(function()
if cd == false then
cd = true
print("no")
local check2 = event:InvokeServer({3, "M3"})
if check2 == true then
hum.WalkSpeed = 16
hum.JumpHeight = 7.2
count = 4
end
task.wait(.2)
cd = false
end
end)
end
elseif count == 4 then
local check1 = event:InvokeServer({4, "Start"})
if check1 == "Proceed" then
hum.WalkSpeed = 0
hum.JumpHeight = 0
anims.M4:Play()
anims.M4:GetMarkerReachedSignal("Hit"):Connect(function()
if cd == false then
cd = true
print("no")
local check2 = event:InvokeServer({4, "M4"})
if check2 == true then
hum.WalkSpeed = 16
hum.JumpHeight = 7.2
count = 1
end
task.wait(.2)
cd = false
end
end)
end
end
else
count = 1
end
help and feedback would be appriciated.
i narrowed the problems down to here
if Tick - lastAttackTick < resetTime then
else
count = 1
end