Why doesn't it play the animation?

Everything works, but it isn’t playing the animations any clue why?

tool = script.Parent
debounce = nil 

function Attack() 
	if debounce == nil then
		print("0")
		local anim = tool:WaitForChild("Animation")
		local humanoid = script.Parent.Parent:WaitForChild("Humanoid")
		local animTrack = humanoid:LoadAnimation(anim)

		animTrack:Play()
		debounce = true
		wait(3)
		debounce = nil
	end

end

tool.Activated:Connect(Attack) 

tool.Handle.HitBox.Touched:Connect(function(hit)
	local humanoid = hit.Parent:FindFirstChild("Humanoid")
	if humanoid.Parent ~= tool.Parent and debounce == true then
		print("1")
		humanoid.Health -= 3
	end
end)
3 Likes

did you put the animation under the tool?

1 Like

Yes i did seing in this picture, I also put an animation id in it!

image

1 Like

in the script you named it tool but the tool is called scythe

1 Like

But that is the variable it has nothing to do with that?

1 Like

oh ok lemme check the script

14174791645781g3uibdijnfwg3ehgeg

1 Like

Maybe the Animation ID is invalid?

1 Like

Does it show any errors? about the animation? Is it your animation?

1 Like

did u make the script r15 or r6 and make sure you make the animation a r15 or r6 whatever the script is

1 Like

Players.SpiderLeander1.Backpack.Scythe.Script:23: attempt to index nil with ‘Parent’

2 Likes

I made the animation R15 my game is also R15 so it should work!

1 Like

but is the script r15?

1241wfqefwedfwegfwergwegwgwgw

1 Like

What do you mean is the script r15?

1 Like

idrk im not very advanced at scripting

1 Like

Have you found anything useful yet?

1 Like

So the error seems to be that the code is trying to damage the player touching the part but as…

Im currently looking into it there a problem on line 23

1 Like

Yeah and it`s also not playing the animation!

1 Like

When did you create the animation? today yesterday or?

1 Like

I think yesterday, but i don`t actually know

1 Like

Cause sometimes you need to wait until it gets trough moderation
you have been creating animations in the past or just starting?

1 Like