Why isn't my script working?

This script is supposed to make and animation play when a tool is equipped and clicked?

script.Parent.Equipped:Connect(function(Mouse) 
    Mouse.Button1Down:Connect(function()
        animation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(script.Parent.Animation)
        animation:Play()
    end)
end)

script.Parent.Unequipped:Connect(function()
    animation:Stop()
end)

This is the explorer:

image

It appears you just took an animation from animation editor and put it in a tool. You first have to upload the animation to roblox, put a new animation into the dummy, put the animationId in the new animation, and then this would work

yes upload the animation then insert it into the tool you took it from animation editor

is the model
if you want the anim to play even when its not equipped just change back to mouse.Button1Down