I’m currently making a combat system for one of my games but one of the main problems that can be found is that button mashing the mouse buttons will just make it so you trade hits one after another
That’s where the stagger system comes in play and makes it so if you get hit, you’re essentially stunned but the main problem is that it does not stack with another hit
So if you’re doing a basic 3 hit combo, the enemy will have a opening after the original timing to hit you if they button mash or something
I just need a idea of how I can stack the staggering instead of just a one time thing or at least reset the time so you can safely combo the enemy
-- The whole module w/o the the slowdown
function handler:stagger(victim, length, orgSpeed)
if victim:GetAttribute("IsBlocking") == true then return end -- If the victim is blocking then the stagger will be ignored
local animation = victim.Humanoid:FindFirstChild("Animator"):LoadAnimation(script:WaitForChild("Stagger"))
animation:Play(0)
slowdown(victim, true, orgSpeed)
disableEvent:Fire(victim, true) -- Disables the ability to attack or block through telling the other script to disable it
task.wait(length) -- Most likely where my problem is
animation:Stop(0)
slowdown(victim, false, orgSpeed)
disableEvent:Fire(victim, false) -- Re - enables the ability to attack / block
end