So, it’s trying to find my humanoid instead of the enemy’s humanoid for some odd reason, and I keep looking back and seeing the issue here-
function CombatHandler.CombatStarted(Player, Character, Humrp, Count)
local Character = Player.Character
local Hum = Character.Humanoid
local Folder = Instance.new("Folder")
Folder.Name = Player.Name.."Folder"
Folder.Parent = workspace
Debris:AddItem(Folder, 0.25)
Hitbox = Meshes.Hitbox:Clone()
Hitbox.Parent = Folder
Hitbox.CFrame = Humrp.CFrame * CFrame.new(0,0,-2)
local Weld = Instance.new("ManualWeld")
Weld.Part0 = Hitbox
Weld.Part1 = Humrp
Weld.C0 = Weld.Part0.CFrame:ToObjectSpace(Weld.Part1.CFrame)
Weld.Parent = Weld.Part0
local pos1 = Hitbox.Position - (Hitbox.Size/2)
local pos2 = Hitbox.Position + (Hitbox.Size/2)
local Re3 = Region3.new(pos1, pos2)
local Blacklist = OverlapParams.new()
Blacklist.FilterType = Enum.RaycastFilterType.Blacklist
Blacklist.FilterDescendantsInstances = {Character}
local HumanoidFound = false
local HBFinder = workspace:GetPartBoundsInBox(Re3.CFrame, Re3.Size, Blacklist)
Debris:AddItem(Hitbox, 0.3)
for i, parts in pairs (HBFinder) do
local enemyChar = parts.Parent
local enemyHumanoid = parts.Parent.Humanoid
print("What's going on?")
local M1Stun = Instance.new("BoolValue")
M1Stun.Name = "Stun"
M1Stun.Parent = enemyHumanoid
local enemyRootPart = parts.Parent.HumanoidRootPart
if Character:FindFirstChild("Stun") then print("You are stunned?!") return end
if enemyHumanoid:FindFirstChild("IsBlocking").Value == true then
DMG = DMG/5
end
if Hum:FindFirstChild("IsBlocking").Value == true then
return
end
enemyHumanoid:TakeDamage(DMG)
enemyHumanoid.WalkSpeed = 4
enemyHumanoid.JumpPower = 0
Debris:AddItem(M1Stun, 0.25)
enemyHumanoid.WalkSpeed = 15
enemyHumanoid.JumpPower = 50.125
if Count == 4 then
local BV = Instance.new("BodyVelocity", parts.Parent.HumanoidRootPart)
BV.MaxForce = Vector3.new(22500, 22500, 22500)
BV.P = 33300
BV.Velocity = -parts.Parent.HumanoidRootPart.CFrame.LookVector * 40
Debris:AddItem(BV, 0.25)
end
break
end
end
