Hitbox Doesn't work on actual players

Everything I do with my hitbox works perfectly fine against dummies non players. But It just doesn’t work on players. Why?

PunchEvent.OnServerEvent:Connect(function(player)
local character = player.Character
local HumRoot = character:WaitForChild("HumanoidRootPart")
local Humanoid = character:WaitForChild("Humanoid")
local punchparams = OverlapParams.new()
punchparams.FilterDescendantsInstances = {character}
punchparams.FilterType = Enum.RaycastFilterType.Exclude
local hitcontents = workspace:GetPartBoundsInBox(HumRoot.CFrame*CFrame.new(0,0,-3), Vector3.new(3.5,3.5,3.5), punchparams)
for i,v in hitcontents do
	if CanConnect[player.Name] then
		local EnemyCharacter = v.Parent
		local EnemyHumanoid = EnemyCharacter:WaitForChild("Humanoid")
		local EnemyPlayer = Players:GetPlayerFromCharacter(EnemyCharacter)
		if EnemyPlayer ~= nil then
			print("contacted a player")
				if EnemyHumanoid.Health > 0 then
					if EnemyHumanoid:GetAttribute("Blocking") == true then
						print("blocked")
					elseif EnemyHumanoid:GetAttribute("Parry") == true then
						local parryanim = Instance.new("Animation")
						parryanim.AnimationId = 'rbxassetid://17637392225'
						local parrytrack = EnemyHumanoid:FindFirstChild("Animator"):LoadAnimation(parryanim)
						parryanim:Destroy()
						parrytrack:Play()
						StunModule.parry(Humanoid, 2)
					elseif EnemyHumanoid:GetAttribute("Parry") == false and EnemyHumanoid:GetAttribute("Blocking") == false then
						CanConnect[player.Name] = false
						KillEvent:FireClient(player, EnemyHumanoid)
						StunModule.stun(EnemyHumanoid, 0.4, 5)
						CanConnect[player.Name] = true
					end
				end
		break
		elseif EnemyPlayer == nil then
		print("hit a dummy")
		if EnemyHumanoid.Health > 0 then
		if EnemyHumanoid:GetAttribute("Blocking") == true then
			print("blocked")
		elseif EnemyHumanoid:GetAttribute("Parry") == true then
					local parryanim = Instance.new("Animation")
					parryanim.AnimationId = 'rbxassetid://17637392225'
					local parrytrack = EnemyHumanoid:FindFirstChild("Animator"):LoadAnimation(parryanim)
					parryanim:Destroy()
					parrytrack:Play()
			StunModule.parry(Humanoid, 2)
		elseif EnemyHumanoid:GetAttribute("Parry") == false and EnemyHumanoid:GetAttribute("Blocking") == false then
					CanConnect[player.Name] = false
					KillEvent:FireClient(player, EnemyHumanoid)
					StunModule.stun(EnemyHumanoid, 0.4, 5)
					CanConnect[player.Name] = true
					end
		end
		break
	end
	end
end

end)
1 Like

Do you get any error? That would make it easier to see what is the problem.

nope, not a single one. im very very confused

Just to be sure you don’t use an localscript right?

Nope, all of this is on a serverscript in SSS

Are you sure that the player has the atributes?

They are given the attributes through another script

Can you share the output of the console?

the output goes through the HP thing, but it stops at the stun module, it says
“hit a player”
“above 0 hp”
i put a print in the module but it doesn’t print

It likely can’t get the whole humanoid you just need to passtrough the name of the player and transform it in the module script. (btw did you require the script xD)

i infact did require it. (at least i didn’t forget that lol) but ill test that and see if it works