I’ve been adding Animations for a pickaxe model and when I scripting in the mining animation, I noticed it wasn’t playing when the player used the tool. I also noticed this error in my output

I don’t know if I’m limited to the number of animations I can play at once or if it’s something else. I thought it was the Animation’s Name and a function’s name being the same, so I changed the Animation’s name but it still gave me the same error and never worked. Here’s what the pickaxe Looks like in the workspace.

here’s the script as well:
local player = game:GetService("Players").LocalPlayer
local RunService = game:GetService("RunService")
--Variables
local animations = {
script.Parent.Animations.Idle, --Idle Animation
script.Parent.Animations.Walk, --Walking Animation
script.Parent.Animations.Run, --Sprinting Animation
script.Parent.Animations.Hit --Mining Animation
}
local loadedAnimations = {}
local tool = script.Parent
local hum = player.Character:WaitForChild("Humanoid")
local animator = hum:WaitForChild("Animator")
local miningSpeed = tool:WaitForChild("MiningSpeed").Value
local debounce = false
local ToolHeld = false
--Functions
function Update()
if ToolHeld == true then
if not loadedAnimations[2] then
loadedAnimations[2] = animator:LoadAnimation(animations[2])
end
if hum.Health > 0 and hum.MoveDirection.Magnitude ~= 0 then
if not loadedAnimations[2].IsPlaying then
loadedAnimations[2]:Play()
end
else
if loadedAnimations[2].IsPlaying then
loadedAnimations[2]:Stop()
end
end
end
end
local function Mine()
if debounce == false then
debounce = true
if(not loadedAnimations[4]) then
loadedAnimations[4] = animator:LoadAnimation(loadedAnimations[4])
end
loadedAnimations[4]:Play()
tool.Mining.Value = true
wait(0.1)
tool.Mining.Value = false
wait(miningSpeed)
debounce = false
end
end
--Set Up
RunService.RenderStepped:Connect(Update)
tool.Equipped:Connect(function(mouse)
if not loadedAnimations[1] then
loadedAnimations[1] = animator:LoadAnimation(animations[1])
end
ToolHeld = true
loadedAnimations[1]:Play()
end)
tool.Activated:Connect(Mine)
tool.Unequipped:Connect(function()
loadedAnimations[1]:Stop()
if(loadedAnimations[4])then
loadedAnimations[4]:Stop()
elseif(loadedAnimations[2])then
loadedAnimations[2]:Stop()
end
ToolHeld = false
end)
Any help will be greatly appreciated
Edit: Note that “loadedAnimations[4]” is the mining animation, that isn’t working