Animation returning nil but why?

Dont flag this post, here is not much to say about. It just give me nil and I dont know why

image

This is my HumanoidNPC:

sword.Touched:Connect(function(hitted)
– if hitted ~= player.Character and not hitted:IsDescendantOf(player.character) then
local HumanoidRootPart = hitted.Parent:FindFirstChild(“HumanoidRootPart”)
local HumanoidNPC = hitted.Parent:FindFirstChild(“Humanoid”)

Maybe the animation got content deleted? But that is unlikely.

Can I see what your HumanoidNPC is?

yea:

sword.Touched:Connect(function(hitted)
--	if hitted ~= player.Character and not hitted:IsDescendantOf(player.character) then
			local HumanoidRootPart = hitted.Parent:FindFirstChild("HumanoidRootPart")
			local HumanoidNPC = hitted.Parent:FindFirstChild("Humanoid")

it does work if its not my humanoid

You need to check if there is a Humanoid

if HumanoidNPC then

I solved this there shoudnt be a big problem anymore