Make it so when you swing and move you don’t run and block the hit animation from playing
local activeSwing = false
tool.Activated:Connect(function()
if justPulledOut == false and swingDelay == false then
activeSwing = true
Hit:Play()
Idle:Stop()
run:Stop()
wait(1)
activeSwing = false
end
end)
while true do
wait(0.2)
if active == true and activeSwing == false then
char.Humanoid.Running:Connect(function(speed)
if speed > 5 then
print("Running")
run:Play()
Idle:Stop()
elseif speed < 5 then
run:Stop()
Idle:Play()
end
end)
end
end
char.Humanoid.Running:Connect(function(speed)
if active == true and activeSwing == true then
if speed > 5 then
print("Running")
run:Play()
Idle:Stop()
elseif speed < 5 then
run:Stop()
Idle:Play()
end
end
end)
The reason it’s playing a running animation while you move is because when you aren’t swinging, it connects to the humanoid whenever it runs, but it won’t stop being connected unless you disconnect it. Meaning once you’re not swinging, it’ll always make you play an animation when running. This makes it so that it connects only once, and checks if they aren’t swinging