Walking Animation Broke when Tool equipped

[This might be in the wrong topic correct me if im wrong]

So if a player equips his sword and walks, the walking animation breaks.

wait()
-- Variables 
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local WeaponStats = require(ReplicatedStorage:WaitForChild("WeaponStats"))
local DistanceModule = require(ReplicatedStorage:WaitForChild("DistanceModule"))

-- Player
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
local Humanoid = Character:WaitForChild("Humanoid")
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")


-- Tool
local Tool = script.Parent
local AnimationsAction = Tool.ActionAnimations:GetDescendants()
local Sounds = Tool.Sounds:GetDescendants()

local EventBlock = Tool.BlockingEvent
local Event = Tool.Event

local IdleAnimation = Tool.IdleAnimation
local Equip = Humanoid:LoadAnimation(IdleAnimation)

Tool.Activated:Connect(function()
		Tool.Event:FireServer(Player)
end)

Tool.Equipped:Connect(function()
	Equip:Play()
end)	

Tool.Unequipped:Connect(function()
	Equip:Stop()
end)	

This is likely how you made the Idle animation for your weapon. Looking at your script, your Idle animation plays and stops when you equip the weapon, which is what stops the walking animation. When making animation, you are able to disable which parts are affected by the animation, and in this case you’d want to disable the legs and maybe head/torso.

I hope this helps!

How would i be able to do that?

If you edited your legs in the animation and put it on Action Priority then it will stop the walking animation.
So check if you have edited your legs in the animation.
If you have just remove that part.
(The same problem happened to me yesterday.)

Set the tool animation Priority to Action

local Equip = Humanoid:LoadAnimation(IdleAnimation)
Equip.Priority = Enum.AnimationPriority.Action

Hope this helps…

For it to work is it not already on Action?

The default priority is Core. I read you want it almost always on action.

But for the animation to stop the walking animation it needs to be on Action already.