function onTouched(Z)if Z.Parent==nil or Z.Name=="\066\117\108\108\101\116"then return end local H=Z.Parent:findFirstChild("\072\117\109\097\110\111\105\100")if ball.Name=="\066\117\108\108\101\116"then for Z=1,3,1 do local S=Instance.new("\080\097\114\116")S.Name="\083\104\097\114\100"S.Shape=1 S.formFactor=2 S.Size=Vector3.new(.4,.4,.4)S.BrickColor=BrickColor.new(blacks[math.random(#blacks)])S.Material=Enum.Material.Plastic local w=Vector3.new(math.random(-1,1),math.random(0,1),math.random(-1,1))S.Velocity=125*w S.CFrame=CFrame.new(ball.Position+w,w)local e=script:clone()e.Disabled=false e.Parent=S S.Parent=game.Workspace local N=ball:findFirstChild("\099\114\101\097\116\111\114")if N~=nil then local Z=N:clone()Z.Parent=S end debris:AddItem(S,2)if H~=nil then tagHumanoid(H)H:TakeDamage(damage)wait(2)untagHumanoid(H)end connection:disconnect()ball.Parent=nil end else if H~=nil then tagHumanoid(H)H:TakeDamage(10)wait(2)untagHumanoid(H)ball.Parent=nil end connection:disconnect()end end function tagHumanoid(Z)local H=ball:findFirstChild("\099\114\101\097\116\111\114")if H~=nil then local S=H:clone()S.Parent=Z end end function untagHumanoid(Z)if Z~=nil then local H=Z:findFirstChild("\099\114\101\097\116\111\114")if H~=nil then H.Parent=nil end end end connection=ball.Touched:connect(onTouched)wait(8)
--removedLength = 8
function onTouched(hit)
	if hit.Parent == nil or hit.Name == "Bullet" then
		return
	end
	local humanoid = hit.Parent:findFirstChild("Humanoid")
	if ball.Name == "Bullet" then
		-- make a splat
		for i = 1, 3 do
			local s = Instance.new("Part")
			s.Name = "Shard"
			s.Shape = 1 -- block
			s.formFactor = 2 -- plate
			s.Size = Vector3.new(0.4, 0.4, 0.4)
			s.BrickColor = BrickColor.new(blacks[math.random(#blacks)])
			s.Material = Enum.Material.Plastic
			local v = Vector3.new(math.random(-1, 1), math.random(0, 1), math.random(-1, 1))
			s.Velocity = 125 * v
			s.CFrame = CFrame.new(ball.Position + v, v)
			local new_script = script:clone()
			new_script.Disabled = false
			new_script.Parent = s
			s.Parent = game.Workspace

			local tag = ball:findFirstChild("creator")
			if tag ~= nil then
				local new_tag = tag:clone()
				new_tag.Parent = s
			end

			debris:AddItem(s, 2)

			if humanoid ~= nil then
				tagHumanoid(humanoid)
				humanoid:TakeDamage(damage)
				wait(2)
				untagHumanoid(humanoid)
			end

			connection:disconnect()
			ball.Parent = nil
		end
	else
		if humanoid ~= nil then
			tagHumanoid(humanoid)
			humanoid:TakeDamage(10)
			wait(2)
			untagHumanoid(humanoid)
			ball.Parent = nil
		end
		--removedLength = 2
		connection:disconnect()
	end
end

function tagHumanoid(humanoid)
	-- todo: make tag expire
	local tag = ball:findFirstChild("creator")
	if tag ~= nil then
		local new_tag = tag:clone()
		new_tag.Parent = humanoid
	end
end

function untagHumanoid(humanoid)
	if humanoid ~= nil then
		local tag = humanoid:findFirstChild("creator")
		if tag ~= nil then
			tag.Parent = nil
		end
	end
end

connection = ball.Touched:connect(onTouched)

wait(8)
