Issue with enemies disappearing when I hit them w/ my weapon

I’ve been having an issue with my game where whenever you hit an enemy with your weapon, there’s a chance of the enemy randomly disappearing. I’m not really sure what’s causing it, but I think it has to do with my damage script.
video of the issue:

If I had to guess, the issue could be with either
a) some issue with line 22 where I set up ragdoll knockback distance
b) some issue in line 18, which has been giving me an error I don’t know how to fix reading, “Players.playerpack12345.Backpack.Bat.Damage:18: attempt to index nil with ‘FindFirstChild’”.

Why is this issue happening and how can I fix it?

damage script:

local tool = script.Parent
local bat = tool.BatModel
local damage_re = tool:WaitForChild("SwingEvent")
local hitsound = bat.BatHit
local ragdollmodule = require(game:GetService("ServerScriptService").Ragdoll)
local kbmodule = require(game:GetService("ServerScriptService").Knockback)

local hitbox ="Part",tool)

local connection = nil --we technically don't need this anymore, but since we set something to it later we have to include it or stop using it

local hitlist = {}

local function inflict_damage(other_object,part)
	if(not hitlist[other_object.Parent]) then --check if the parent has already been seen
		local humanoid = other_object.Parent:FindFirstChild("Humanoid")
		if humanoid then
			hitlist[other_object.Parent] = true --This can be anything other than nil or false.  It's the value we get back when we ask what is inside hitlist[other_object.Parent].  It will be nil if it doesn't exist, but will be true in this case if it does exist in the hitlist.
			kbmodule.Start(humanoid.Parent, (humanoid.Parent.HumanoidRootPart.Position - other_object.Position).Unit *,0,60) +,40))
			for i in hitlist do
		--We don't disconnect here anymore.  If we disconnect, then we will only run this function on the first block we hit, but we want it to run on all of them.

	local hitbox ="Part",tool)
	hitbox.Size =,5,1)
	hitbox.CanCollide = false
	hitbox.Massless = true
	hitbox.Transparency = 0.7 --debug

	local weld ="Weld",hitbox)
	weld.Part0 = bat
	weld.Part1 = hitbox

	hitlist = {} --resets hitlist by creating a new list
	connection = hitbox.Touched:Connect(inflict_damage)

--i got this script on youtube:
--any changes from the original were made by me and mostly this dude tlr22 on the devforum so props 2 him

(im super new to scripting so forgive me if i dont understand something)