function Check(R)for R,N in ipairs(R:GetChildren())do if N:IsA("\073\110\116\086\097\108\117\101")==true then if N.Value==id then return false end end end return true end Shield.Touched:connect(function(R)if R==nil then return end if R.Parent==nil then return end local N=R.Parent if N:IsA("\084\111\111\108")==true then return end if R.Name=="\084\111\114\115\111"then return end if R.Name=="\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116"then return end if R.Name=="\076\101\102\116 \076\101\103"then return end if R.Name=="\082\105\103\104\116 \076\101\103"then return end if R.Name=="\072\101\097\100"then return end if R.Name=="\076\101\102\116 \065\114\109"then return end if R.Name=="\082\105\103\104\116 \065\114\109"then return end if R:FindFirstChild("\080\105\101\114\099\101")~=nil then return end if Check(R)==false then return end if(Game:GetService("\080\108\097\121\101\114\115")):GetPlayerFromCharacter(N)~=nil then return end for R,N in ipairs(R:GetChildren())do if N:IsA("\084\111\117\099\104\084\114\097\110\115\109\105\116\116\101\114")==true then N:Destroy()break end end Shield:Destroy()end)function CreateRegion3FromLocAndSize(R,N)local p=N/2 local t=R-p local C=R+p return Region3.new(t,C)end function FindNear(R,N)local p=CreateRegion3FromLocAndSize(R.Position,Vector3.new(R.Size.X+N,50,R.Size.Z+N))return(Game:GetService("\087\111\114\107\115\112\097\099\101")):FindPartsInRegion3(p,R,100)end while Shield and Shield.Parent do for R,N in ipairs(FindNear(Shield,15))do if N:IsA("\066\097\115\101\080\097\114\116")==true then local R,p=GetOwnerAndDamage(N)if R~=nil and(p~=nil and(N:FindFirstChild("\080\105\101\114\099\101")==nil and Check(N)==true))then if(N.Position-Shield.Position).magnitude<=15 and N~=Shield then N:Destroy()Shield:Destroy()end end end end;(Game:GetService("\082\117\110\083\101\114\118\105\099\101")).Stepped:wait()end
--local busy = false
--Shield.Touched:connect(function(Hit)
--	if Hit == nil then return end
--	if Hit.Parent == nil then return end
--	if busy == true then return end
--
--	busy = true
--
--	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 Game:GetService("Players"):GetPlayerFromCharacter(Item) ~= nil then return end
--
--	local touch = false
--	for _, x in ipairs(Hit:GetChildren()) do
--		if x:IsA("TouchTransmitter") == true then touch = true x:Destroy() break end
--	end
--
--	local owner, dmg = GetOwnerAndDamage(Hit)
--	if owner ~= nil and dmg ~= nil then
--		if Health > 0 then
--			if Health >= dmg then
--				Health = Health - dmg
--
--				if Health < 0 then Health = 0 end
--
--				HealthBar.Shield.Bar:TweenSize(UDim2.new((Health / MaxHealth), 0, 1, 0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 0.5, true)
--
--				if Health > 0 then
--					-- yay, still alive.
--				else
--					HealthBar.Parent.Parent:Destroy()
--				end
--
--				Hit:Destroy()
--			else
--				HealthBar.Parent.Parent:Destroy()
--			end
--		else
--			HealthBar.Parent.Parent:Destroy()
--		end
--	else
--		if touch == true then
--			--Hit:Destroy()
--		end
--	end
--
--	busy = false
--end)

function Check(p)
	for _, x in ipairs(p:GetChildren()) do
		if x:IsA("IntValue") == true then
			if x.Value == id then
				return false
			end
		end
	end

	return true
end

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 Check(Hit) == false 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

	Shield:Destroy()
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 Shield and Shield.Parent 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 and Check(item) == true then
				if (item.Position - Shield.Position).magnitude <= 15 and item ~= Shield then
					item:Destroy()

					Shield:Destroy()
				end
			end
		end
	end

	Game:GetService("RunService").Stepped:wait()
end
