snippet:
local lastCombo: IntValue = character.Core:WaitForChild("LastCombo")
local lastSwing: IntValue = character.Core:WaitForChild("LastSwing")
local swingNumber: IntValue = character.Core:WaitForChild("SwingNumber")
local MAX_COMBO: IntValue = 4
if (os.clock() - lastCombo.Value) < DataValues.ComboCooldown then return end
if (os.clock() - lastSwing.Value) >= DataValues.M1Reset then
swingNumber.Value = 1
print("Reset combo to swing 1")
else
swingNumber.Value += 1
print("Continuing combo, swing:", swingNumber.Value)
end
if swingNumber.Value > MAX_COMBO then
swingNumber.Value = 1
lastCombo.Value = os.clock()
print("Max combo reached, resetting swings, starting cooldown")
return
end
lastSwing.Value = os.clock()
local attackingInstance = Instance.new("BoolValue")
attackingInstance.Name = "M1"
attackingInstance.Parent = character
local animator = character.Humanoid:FindFirstChild("Animator")
local animationToPlay: AnimationTrack = animator:LoadAnimation(animations["L"..tostring(swingNumber.Value)])
print("Playing animation: L" .. tostring(swingNumber.Value))
debris:AddItem(attackingInstance, animationToPlay.Length)
animationToPlay:Play()
animationToPlay:GetMarkerReachedSignal("Hit"):Once(function()
print("Hit marker reached for swing:", swingNumber.Value)
always plays all the anims on the first swing, but works completely fine otherwise

** You are now Level 2! **
