Animation on tool won't work part 2: Electric Boogaloo

Here is the post before this one. We got a nil conclusion on it, so i’m asking again.

What do you want to achieve? I want to make my animation move on my tool.

What is the issue? My Script won’t work. It was modified after the answers that i got from my last post. Here it is:

local player = game:GetService("Players").LocalPlayer 
local Character = player.character or player.CharacterAdded:wait() 
local Animation = script.Parent:FindFirstChild("Attack")
local AttackAnimation = Character:WaitForChild("Humanoid"):LoadAnimation(Animation) 

local CanAttack = true

script.Parent.Activated:Connect(function()
	if CanAttack then
		CanAttack = false
		AttackAnimation:Play()
		wait(1)
		CanAttack = true
	end
end)

and here’s a screenie of the parents:

Bez tytułu

I tried using the script you showed, and it worked for me.

Anyways, try this:

local player = game:GetService("Players").LocalPlayer 
local Character = player.Character or player.CharacterAdded:Wait() 
local Animation = script.Parent:FindFirstChild("Attack")
local AttackAnimation = Character:WaitForChild("Humanoid"):LoadAnimation(Animation) 

local CanAttack = true

script.Parent.Activated:Connect(function()
	if CanAttack then
		CanAttack = false
		AttackAnimation:Play()
		wait(1)
		CanAttack = true
	end
end)