Animation script wont play

I want to change the animation of this tool attack.

function Sword:Slash(ticket)
	Sword.State = 'Slashing'
	
	Handle.SlashSound:Play()
	Sword:Animate'Slash'
	
	wait(0.5)

I tried changing it to this but it doesnt work.

function Sword:Slash(ticket)
	local animation = script.Parent.swing
	Sword.State = 'Slashing'
	
	Handle.SlashSound:Play()
	animation:Play()
	
	wait(0.5)

Ive tried a few other ways also, but it doesn’t seem to work. What am I doing wrong here.

You will have to use Humanoid:LoadAnimation as that returns AnimationTrack which has the function to :Play().

Animations have to be loaded onto the character to work.

Alternatively you can create a StringValue called toolanim and use the default action animations

local str = Instance.new("StringValue")
str.Name = "toolanim"
str.Value = "Slash" -- try also: Lunge
str.Parent = tool

To play an animation you would have to use :LoadAnimation() from the humanoid then play it from there!