How do i filter players in a server script for filterdescendantsinstance

i made a hitbox script for a dummy only the problem is. is that i cant get to filter the players to only get hit
here is my code

local function CreateNpcHitbox()
	local playerlist = game.Players:GetPlayers()

	local offset = 3
	local npchitbox = Instance.new("Part")	
	npchitbox.CanCollide = false
	npchitbox.Anchored = true
	npchitbox.Transparency = 0.9
	npchitbox.Size = Vector3.new(3,3,3)
	npchitbox.CFrame = PrimaryPart.CFrame + (PrimaryPart.CFrame.LookVector * offset)
	wait(0.2)
	npchitbox.Parent = script.Parent.Parent
	local IsActive = true
	
	local overlaparams = OverlapParams.new()
	overlaparams.FilterDescendantsInstances = {}
	overlaparams.FilterType = Enum.RaycastFilterType.Include
	
	game:GetService("RunService").Heartbeat:Connect(function()
		if not IsActive then return end
		local hitcontent = workspace:GetPartsInPart(npchitbox,overlaparams)
		for i, v in ipairs(hitcontent) do
			local p_character = v.Parent
			local p_humanoid = p_character:FindFirstChild("Humanoid")
			if p_humanoid and not hitCharacters[p_character] then
				print("work")
				local currentTime = tick()
				local lastHit = lastHitTime[p_humanoid]
				if not lastHit or currentTime - lastHit >= cooldown then
					p_humanoid:TakeDamage(10)
					hitCharacters[p_character] = true
					lastHitTime[p_humanoid] = currentTime
				end
			end
		end
	end)	
	spawn(function()
		wait(0.3)
		IsActive = false
		npchitbox:Destroy()
		hitCharacters = {}
	end)
end

the code does work only if i set the instances to empty the npc that i created the hitbox for will take damage instead of the players

local function CreateNpcHitbox()
    local playerlist = game.Players:GetPlayers()

    local offset = 3
    local npchitbox = Instance.new("Part")    
    npchitbox.CanCollide = false
    npchitbox.Anchored = true
    npchitbox.Transparency = 0.9
    npchitbox.Size = Vector3.new(3,3,3)
    npchitbox.CFrame = PrimaryPart.CFrame + (PrimaryPart.CFrame.LookVector * offset)
    wait(0.2)
    npchitbox.Parent = script.Parent.Parent
    local IsActive = true

    local overlaparams = OverlapParams.new()
    overlaparams.FilterDescendantsInstances = {} -- Filtered instances go here
    overlaparams.FilterType = Enum.RaycastFilterType.Whitelist -- Use Whitelist filter type

    -- Populate FilterDescendantsInstances with player characters
    for _, player in ipairs(playerlist) do
        local character = player.Character
        if character then
            table.insert(overlaparams.FilterDescendantsInstances, character)
        end
    end

    game:GetService("RunService").Heartbeat:Connect(function()
        if not IsActive then return end
        local hitcontent = workspace:GetPartsInPart(npchitbox,overlaparams)
        for i, v in ipairs(hitcontent) do
            local p_character = v.Parent
            local p_humanoid = p_character:FindFirstChild("Humanoid")
            if p_humanoid and not hitCharacters[p_character] then
                print("work")
                local currentTime = tick()
                local lastHit = lastHitTime[p_humanoid]
                if not lastHit or currentTime - lastHit >= cooldown then
                    p_humanoid:TakeDamage(10)
                    hitCharacters[p_character] = true
                    lastHitTime[p_humanoid] = currentTime
                end
            end
        end
    end)    
    spawn(function()
        wait(0.3)
        IsActive = false
        npchitbox:Destroy()
        hitCharacters = {}
    end)
end