RaycasthitboxV4 not dealing damage

I made a bat that uses a hitbox module. The hitbox module is very known and i’m not sure if I set it up correctly. The localscript is very small hopefully you can read it

local Tool = script.Parent
local RaycastHitbox = require(game.ReplicatedStorage.RaycastHitboxV4)
Handle = Tool:WaitForChild("Handle")
local Hitbox = RaycastHitbox.new(Handle)
-- Player
local Player = game.Players.localPlayer
local Debris = game:GetService("Debris")
-- Folders
local animFolder = script.Parent.Animations
local eventFolder = script.Parent.Events
local soundFolder = script.Parent.Sounds
-- Animations
local equipAnim = animFolder.Equip
local idleAnim = animFolder.Idle
local swingAnim = animFolder.Swing1
local swingAnim2 = animFolder.Swing2
-- Sounds
local equipSound = soundFolder.Equip
local swingSound = soundFolder.Swing1
local swingSound2 = soundFolder.Swing2
-- Events
local swingEvent = eventFolder.Swing
-- Scripts
--
local debounce = false
local actDebounce = false
local combo = 1
CanHit = true
-- Values
local Damage = Tool.Settings.Damage

local function ToolEquipped()
	if not debounce then
		debounce = true
		local humanoid = script.Parent.Parent.Humanoid 
		equip = humanoid:LoadAnimation(equipAnim)
		idle = humanoid:LoadAnimation(idleAnim)
		Hitbox.DetectionMode = RaycastHitbox.DetectionMode.PartMode
		Hitbox.Visualizer = true	
		equip:Play()
		equipSound:Play()	
		wait()
		idle.Looped = true
		idle:Play()
		debounce = false
	end
end

local function Unequipped()
	if equip.IsPlaying then
		equip:Stop()
	end
	if idle.IsPlaying then
		idle:Stop()
	end
end

local function Activated()
	if not debounce then
		debounce = true
		if combo == 1 then
			local swing = Tool.Parent.Humanoid:LoadAnimation(swingAnim)
			CanHit = true
			Hitbox:HitStart() 
			swing:Play()
			swingSound:Play()
			wait(1)
			combo = 2
			Hitbox:HitStop() 
			CanHit = false
			wait(0.3)
			debounce = false
		elseif combo == 2 then
			local swing2 = Tool.Parent.Humanoid:LoadAnimation(swingAnim2)
			swing2:Play()
			swingSound2:Play()
			CanHit = true
			Hitbox:HitStart()
			swingEvent:FireServer()
			wait(1)
			Hitbox:HitStop()
			CanHit = false
			wait(0.3)
			combo = 1
			debounce = false			
		end
	end
end


Hitbox.OnHit:Connect(function(hit, humanoid)
	if  humanoid and humanoid ~= script.Parent.Parent.Humanoid then
		local dmg = 20
		humanoid:TakeDamage(dmg)
	end

end)


Tool.Equipped:Connect(ToolEquipped)
Tool.Unequipped:Connect(Unequipped)
Tool.Activated:Connect(Activated)

On the OnHit function add a print to see what is being detected by the raycast which should be a player humanoid.
Turn on raycast visuals in the module to see if your raycast is actually being created.

Also, since this is a local script the damage will not replicate, so you will need to use a remote event to deal damage to players.

I noticed that you’re not using an ignore list, try setting up an ignore list, as the hitbox could be detecting your own character. Also, you said that you are using a LocalScript, which is probably why it’s not damaging.

I use Raycast Hitbox myself, and usually what I’d do is make the OnHit event fire a RemoteEvent to the server instead of damaging the humanoid on the client. Then, on the server, I do some checks to make sure the hit was valid, such as checking if the character is within range of the weapon, and then I would damage the humanoid on the server.

Here’s a quick example of what I mean:

--// Local Script

Hitbox.OnHit:Connect(function(Humanoid)
	HitRemote:FireServer(Humanoid) -- Replace HitRemote with a RemoteEvent that you will use to detect hits
end)
--// Server Script
local MaxDistance = 10 -- This is the estimated range of your weapon
local Damage = 20

HitRemote.OnServerEvent:Connect(function(player, Humanoid)
	local Distance = (player.Character.HumanoidRootPart.Position - Humanoid.Parent.HumanoidRootPart.Position).Magnitude -- This is the distance between the weapon user and the enemy that they hit
	if Distance < MaxDistance then -- Check if the user is less than MaxDistance, in our case, it is 10 studs 
		Humanoid:TakeDamage(Damage)
	end
end)

also, please use task.wait() instead of wait() ww

Edit: Added some comments to make some stuff more understandable ^^