Localscript inside a tool is not loading animations sometimes

For some reason the tool im using in starterpack is not loading animations and is giving the known error of animator not being a descendant of game object. It happens sometimes when I join the game, but always happens when I reset my character after respawning it stops loading. Does anyone know why?

Beginning of script:

local Player = game.Players.LocalPlayer
local Tool = script.Parent
local Character = Player.Character or Player.CharacterAdded:Wait()

if not Character.Parent then
	repeat wait() until Character.Parent
else
	print(Character, Character.Parent, Character.Parent.Parent)
end
1 Like