Roblox Core animations broken

Hey there,

When i join my game, the roblox animations are broken and i only see my character moving, but the legs and arms are not animated. I believe this is because i have a gun and when you hold this gun it plays a holding animation that only gets destroyed once the tool is unequipped, the code for the tool animation can be found here


local player = game.Players.LocalPlayer
local tool = player.Backpack.Sniper
local humanoid1 = script.Parent:FindFirstChild("Humanoid")

local humanoid = Instance.new("Animator", humanoid1)
local anim = humanoid:LoadAnimation(script:WaitForChild("Animation"))
tool.Equipped:Connect(function()
	
	
	
	local md =Instance.new("Motor6D")
	print("weld made")
	md.Parent = player.Character.RightHand
	
	md.Name = "Motor6D"
	md.Part0 = player.Character.RightHand
	md.Part1 = tool.Handle
	anim:Stop()

		anim:Play()
	tool.Unequipped:Connect(function()
		anim:Stop()
		anim:Destroy()

		md:Destroy()
	end)
end)


I have no errors in the output and i will answer all questions, thank you for reading!

Hi, so where do you store the tool?

I store the tool in StarterPack and the animate script is in StarterPlayerScripts

Hi, so I’ve tried out your script in the same circumstances as yours, and one problem I’ve found is you’re running the :LoadAnimation function on the Animator, not the Humanoid, which should cause a error.

Also, script.Parent to your script is just playerscripts (parent of StarterPlayerScripts), not the player, where you would find your humanoid.
This means the animation can’t run, as it can’t find the animator, and would stop your script.
I would advise changing it to

local humanoid1 = player.Humanoid

Forgot the last few lines that were there before, (they’ve gone now), I didn’t read the updated article, sorry