I’m using GetPartsBoundInBox() and it only seems to hit one humanoid. Here’s a shortened version of the code:
local getPartsBound = workspace:GetPartBoundsInBox(targetCFrame, targetSize, overlap)
local alreadyHit = {}
for i,v in pairs(getPartsBound) do
if v:IsA("BasePart") and v.Parent:FindFirstChild("Humanoid") then
if v.Parent:FindFirstChild("Humanoid") and v:IsDescendantOf(workspace.TrainingZones) == false then
if table.find(alreadyHit, v.Parent) then return end
if v.Parent:IsDescendantOf(workspace.NPCS) or v.Parent:GetAttribute("Hyperarmour") == true then return end
local enemyHumanoid = v.Parent:FindFirstChild("Humanoid")
local enemyRoot = v.Parent:FindFirstChild("HumanoidRootPart")
table.insert(alreadyHit, v.Parent)
--damage code has been removed because too long
I’ve tried remove the table.insert and it still only hits one humanoid. Why is this?