Whenever my character is reset, I get this error from my tool. Where am I going wrong here?
local character = player.Character or player.CharacterAdded:Wait() player.CharacterAdded:Connect(function(newCharacter) character = newCharacter end) local hum = character:WaitForChild("Humanoid") local IdleAnim = hum:LoadAnimation(Animations.Idle) -- This is the line erroring local ReloadAnim = hum:LoadAnimation(Animations.Reload) local ShootAnim = hum:LoadAnimation(Animations.Shoot) local DrawAnim = hum:LoadAnimation(Animations.Draw)
LoadAnimation requires the Humanoid object (QuikSilver09.Humanoid) to be a descendant of the game object
Since the issue is the script is trying to grab the old character and the old character is gone. I’d say changing local character to this:
local character = ((character and character.Parent ~= nil and character) or player.CharacterAdded:wait()
It should make sure the character exists first. Try that maybe?