Tool animations error after the player resets with the tool

Ive made a little equip and holding animation for one of my tools but I have encountered an issue while testing it, when the player resets with the tool, the animations will break when they respawn.

The error Cannot load the AnimationClipProvider Service. comes up in output
I believe its due to Animator not being a child of Humanoid or Humanoid not existing at all for a few miliseconds when the player is respawning but I dont know how I could fix it.

Here is a clip

my code that the error comes from
local animEquip = Instance.new("Animation")
animEquip.Parent = Tool
animEquip.AnimationId = "rbxassetid://11463516430"
local AnimEquip = Hum:WaitForChild("Animator"):LoadAnimation(animEquip)

local animHold = Instance.new("Animation")
animHold.Parent = Tool
animHold.AnimationId = "rbxassetid://11463371738"
local AnimHold = Hum:WaitForChild("Animator"):LoadAnimation(animHold)

Tool.Equipped:Connect(function()
	AnimEquip:Play()
	wait(0.18)
	AnimHold:Play()
end)

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

I think it’s because the character isn’t in workspace yet so just
repeat task.wait until character.parent == workspace

Still get the same error

30

Are you waiting before loading any of the anims? you can also just load the animations in Equipped but they might be a little delayed the first time if it’s a server script

Pretty sure
repeat task.wait()
	
local animEquip = Instance.new("Animation")
animEquip.Parent = Tool
animEquip.AnimationId = "rbxassetid://11463516430"
local AnimEquip = Hum:WaitForChild("Animator"):LoadAnimation(animEquip)

local animHold = Instance.new("Animation")
animHold.Parent = Tool
animHold.AnimationId = "rbxassetid://11463371738"
local AnimHold = Hum:WaitForChild("Animator"):LoadAnimation(animHold)

local EquipSFX = Instance.new("Sound")
EquipSFX.Parent = Tool
EquipSFX.SoundId = "rbxassetid://7405483764"

Tool.Equipped:Connect(function()
	AnimEquip:Play()
	EquipSFX:Play()
	wait(0.18)
	AnimHold:Play()
end)

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

until Char.Parent == workspace

If I load the anims in the equip and unequip it still errors but only on the equip and unequip

what you’re doing is running the entire code until the character is in workspace put the until char.Parent == workspace before right under the repeat task.wait()

Also tried that lol, although it doesnt give me an error, just the animations arent working

I don’t know try the same code on a dummy and tell me what happens

not the same but simillar code there might be something wrong with the animator or animations and not the code

The holding animation works on the dummies but the equipping one seems to stop half way through

image

Going to try changing it to loadanimation on the humanoid instead to see if it will work
Edit: still the same error loading it on the humanoid

something could be wrong with the animations themselves or it’s roblox