--Shield.Touched:connect(function(Hit)
--	if Hit == nil then return end
--	if Hit.Parent == nil then return end
--	
--	local Item = Hit.Parent
--	
--	if Item:IsA("Tool") == true then return end
--	if Hit.Name == "Torso" then return end
--	if Hit.Name == "HumanoidRootPart" then return end
--	if Hit.Name == "Left Leg" then return end
--	if Hit.Name == "Right Leg" then return end
--	if Hit.Name == "Head" then return end
--	if Hit.Name == "Left Arm" then return end
--	if Hit.Name == "Right Arm" then return end
--	if Hit:FindFirstChild("Pierce") ~= nil then return end
--	
--	if Game:GetService("Players"):GetPlayerFromCharacter(Item) ~= nil then return end
--	
--	for _, x in ipairs(Hit:GetChildren()) do
--		if x:IsA("TouchTransmitter") == true then x:Destroy() break end
--	end
--end)


function CreateRegion3FromLocAndSize(Position, Size)
	local SizeOffset = Size / 2
	local Point1 = Position - SizeOffset
	local Point2 = Position + SizeOffset
	return Region3.new(Point1, Point2)
end

function FindNear(part, radius)
	local r = CreateRegion3FromLocAndSize(part.Position, Vector3.new(part.Size.X + radius, 50, part.Size.Z + radius))
	
	return Game:GetService("Workspace"):FindPartsInRegion3(r, part, 100)
end

while true do
	for _, item in ipairs(FindNear(Shield, 15)) do
		if item:IsA("BasePart") == true then
			local own, dmg = GetOwnerAndDamage(item)
		
			if own ~= nil and dmg ~= nil and item:FindFirstChild("Pierce") == nil then
				if (item.Position - Shield.Position).magnitude <= 15 and item ~= Shield then
					item:Destroy()
				end
			end
		end
	end
	
	Game:GetService("RunService").Stepped:wait()
end
