Damage script for Tool

I have a script for a sword that when the animation plays it deals damage to whatever the sword touches.
I’m not getting an error script and there are no error lines. The animation of the sword still plays but it doesn’t deal damage.
Script:

local tool = script.Parent


local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

local InputService = game:GetService("UserInputService")
local InputType = Enum.UserInputType


local animation = nil
local slashAnimation = nil


tool.Equipped:Connect(function()
	animation = Instance.new("Animation")
	animation.AnimationId = "rbxassetid://7118111810"
	slashAnimation = humanoid:LoadAnimation(animation)
end)

s memory.
tool.Unequipped:Connect(function()
	animation:Destroy()
	slashAnimation = nil
end)
doesnt exist.
local debounce = false
InputService.InputBegan:Connect(function(input, processed)
	if input.UserInputType == InputType.MouseButton1 and slashAnimation and not processed then 
		if debounce then return end 
		debounce = true
		slashAnimation:Play()
		local tool = script.Parent

		local function onTouch(partOther)

			local humanOther = partOther.Parent:FindFirstChild("Humanoid")

			if not humanOther then return end

			if humanOther.Parent == tool then return end

			humanOther:TakeDamage(20)
		end




		slashAnimation.Stopped:Wait() 
		debounce = false
	end
end)

You never connected this function anywhere inside your script

local tool = script.Parent

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

local InputService = game:GetService("UserInputService")
local InputType = Enum.UserInputType

local animation = nil
local slashAnimation = nil

tool.Equipped:Connect(function()
	animation = Instance.new("Animation")
	animation.AnimationId = "rbxassetid://7118111810"
	slashAnimation = humanoid:LoadAnimation(animation)
end)

tool.Unequipped:Connect(function()
	animation:Destroy()
	slashAnimation = nil
end)

local debounce = false
InputService.InputBegan:Connect(function(input, processed)
	if input.UserInputType == InputType.MouseButton1 and slashAnimation and not processed then 
		if debounce then return end 
		debounce = true
		slashAnimation:Play()
        local Connection
		local tool = script.Parent

		local function onTouch(partOther)

			local humanOther = partOther.Parent:FindFirstChild("Humanoid")

			if not humanOther then return end

			if humanOther.Parent == tool then return end

			humanOther:TakeDamage(20)
		end

        Connection = tool:WaitForChild("Handle").Touched:Connect(onTouch)

		slashAnimation.Stopped:Wait() 
		debounce = false
        Connection:Disconnect()
	end
end)

I also recommend disconnecting the function as soon as you finish the Animation

Ohhhhhhhhhhhh ya, my bad.