function onTouched(B)if B.Parent==nil or B.Name=="\066\117\108\108\101\116"then return end local n=B.Parent:findFirstChild("\072\117\109\097\110\111\105\100")if ball.Name=="\066\117\108\108\101\116"then for B=1,3,1 do local x=Instance.new("\080\097\114\116")x.Name="\083\104\097\114\100"x.Shape=1 x.formFactor=2 x.Size=Vector3.new(.4,.4,.4)x.BrickColor=BrickColor.new(blacks[math.random(#blacks)])x.Material=Enum.Material.Plastic local c=Vector3.new(math.random(-1,1),math.random(0,1),math.random(-1,1))x.Velocity=125*c x.CFrame=CFrame.new(ball.Position+c,c)local g=script:clone()g.Disabled=false g.Parent=x x.Parent=game.Workspace local X=ball:findFirstChild("\099\114\101\097\116\111\114")if X~=nil then local B=X:clone()B.Parent=x end debris:AddItem(x,2)if n~=nil then tagHumanoid(n)n:TakeDamage(damage)wait(2)untagHumanoid(n)end connection:disconnect()ball.Parent=nil end else if n~=nil then tagHumanoid(n)n:TakeDamage(10)wait(2)untagHumanoid(n)ball.Parent=nil end connection:disconnect()end end function tagHumanoid(B)local n=ball:findFirstChild("\099\114\101\097\116\111\114")if n~=nil then local x=n:clone()x.Parent=B end end function untagHumanoid(B)if B~=nil then local n=B:findFirstChild("\099\114\101\097\116\111\114")if n~=nil then n.Parent=nil end end end connection=ball.Touched:connect(onTouched)wait(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(.4,.4,.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)