--Hitbox Script Start

local function hb(size, cframe, ignore, char) local hb = Instance.new("Part", workspace.Fx) hb.Anchored = true hb.CanCollide = false hb.Transparency = .6 hb.Name = "hb" hb.Material = Enum.Material.ForceField hb.CanQuery = false hb.Size = size hb.CFrame = cframe

local con
con = hb.Touched:Connect(function()
con:Disconnect()
end)

local lasttarg

for i,v in pairs(hb:GetTouchingParts()) do
	**if v.Parent : FindFirstChild("Humanoid") and table.find (ignore, v.Parent) == nil then**
		if lasttarg then
			if (lasttarg.Position -  char.PrimaryPart.Position).Magnitude > (v.Position -  char.PrimaryPart.Position).Magnitude then
				lasttarg = v.Parent.PrimaryPart
			end
		else
			lasttarg = v.Parent.PrimaryPart
		end
	end
end

hb:Destroy()
if lasttarg then
	return lasttarg.Parent
else
	return nil
end

end --HitBox Script Endin

Having trouble with bold line pls help

1 comment

0

change v.Parent to v.Parent:GetChildren()