Maybe I’m just overthinking this, but I can’t come up with a method of breaking a players attack if they’re hit midway through their attack.
For example, player 1 and player 2 both hit at ROUGHLY the same time, but player 1’s hit registers before player 2, breaking player 2 into a stun (which should theoretically let player 1 combo player 2, however player 2’s hit never gets cancelled when he gets stunned and hence ALSO stuns player 1 giving them both this moment of broken awkwardness. Check the video I attached to see a slowed down version of what I mean.
function Swing()
if attacking == false and not blocking and CanAttack and not Player:FindFirstChild("Stun") and Stamina >= 12 then
attacking = true
lastAttack = tick()
Stamina -= 7
Player.Character.Humanoid.JumpPower = 0
if sprinting then
Sprint(false)
end
if attack == 6 then
print("6")
attack = 1
end
Tool.Handle.slash.PlaybackSpeed = math.random(100, 200)/100
Tool.Handle.slash:Play()
Tool.trailblade.Trail.Enabled = true
camShake:ShakeOnce(3, 5, 0.05, 0.1)
local Anim = Player.Character:WaitForChild("Humanoid").Animator:LoadAnimation(ReplicatedStorage.Animations:FindFirstChild(tostring(attack)))
Anim:Play()
Anim.Stopped:Wait()
RemoteAttack:FireServer(Tool, attack, Anim.Length)
attack += 1
attacking = false
Player.Character.Humanoid.JumpPower = 50
Tool.trailblade.Trail.Enabled = false
if attack == 6 then
CanAttack = false
wait(Tool.Cooldown.Value)
CanAttack = true
end
end
end
server side:
RemoteAttack.OnServerEvent:Connect(function(plr, tool, combo, length)
coroutine.resume(coroutine.create(function()
local char = plr.Character
local hrp = char.HumanoidRootPart
local Hitbox = RayCaster:Initialize(tool, {char})
Hitbox:DebugMode()
Hitbox:HitStart()
Hitbox.OnHit:Connect(function(hit, humanoid)
local player = game:GetService("Players"):GetPlayerFromCharacter(humanoid.Parent)
if player.IsBlocking.Value == true then
print("plr blocking!")
blockeffect(humanoid)
elseif player.IsParrying.Value == true then
blockeffect(humanoid)
stun(plr.Character.Humanoid)
else
if combo == 5 then
Knockback(hit, plr.Character)
game:GetService("ReplicatedStorage").Remotes.Knock:FireClient(player)
end
tool.Handle.hit:Play()
humanoid:TakeDamage(tool.Damage.Value)
stun(humanoid)
end
Hitbox:HitStop()
end)
wait(length - 0.1)
Hitbox:HitStop()
end))
end)
also might be good to note i’m using raycast hitbox found here: raycast hitbox module