I made sure that the swing animation has Action priority
The Idle is Idle priority
Idle Script:
local idleid = Instance.new("Animation")
idleid.AnimationId = "rbxassetid://15210978332"
local walkid = Instance.new("Animation")
walkid.AnimationId = "rbxassetid://15212009076"
local playidle,playwalk
local tool = script.Parent
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local hum = char:WaitForChild("Humanoid")
local equipped = false
tool.Equipped:Connect(function()
equipped = true
if not playidle then
playidle = hum:LoadAnimation(idleid)
end
if not playwalk then
playwalk = hum:LoadAnimation(walkid)
end
task.spawn(function()
game:GetService("RunService").RenderStepped:Connect(function()
if equipped == true then
if hum.MoveDirection.Magnitude > 0 then
if playidle.IsPlaying then
playidle:Stop()
end
if not playwalk.IsPlaying then
playwalk:Play()
end
else
if not playidle.IsPlaying then
playidle:Play()
end
if playwalk.IsPlaying then
playwalk:Stop()
end
end
end
end)
end)
end)
tool.Unequipped:Connect(function()
equipped = false
if playwalk.IsPlaying then
playwalk:Stop()
end
if playidle.IsPlaying then
playidle:Stop()
end
end)
tool.Activated:Connect(function()
end)