local bang = script.Parent.Explosion
function ontouch(part)
if part.Parent.Name ~= "Bombs" or "Explosions" then
if part.CanCollide ~= false then
script.Disabled = true
local neon = game.ServerStorage.NeonPart
local plastic = game.ServerStorage.PlasticPart
local clnNeon = neon:Clone()
local clnPlastic = plastic:Clone()
clnNeon.Parent = script.Parent
clnPlastic.Parent = script.Parent
clnNeon.Position = script.Parent.Position
clnPlastic.Position = script.Parent.Position
local normalbomb = Instance.new("Explosion")
normalbomb.BlastPressure = 800000
normalbomb.BlastRadius = 10
normalbomb.Parent = script.Parent
normalbomb.Position = script.Parent.Position
bang.Pitch = (math.random(5,10)*.1)
bang:Play()
wait(.1)
script.Disabled = false
end
end
end -- By this point, I want it to check how many times the function has occurred, if more than 10, break the function. Unsure if any of this is possible.
script.Parent.Transparency = 1
script.Parent.CanCollide = false
local z = 0
repeat
local bitz = game.ServerStorage.BombBit
local bitzCln = bitz:Clone()
bitzCln.Parent = workspace.Bitz
bitzCln.Position = script.Parent.Position
z = z + 1
until z == 4
wait(3)
if not script.Parent == nil then
script.Parent:Destroy()
end
script.Parent.Touched:Connect(ontouch)
Help would be appreciated, sorry for any inconvenience.

2 comments
Please describe more to what you want to do, and how you plan to do it. We cannot answer a request, and we cannot answer something that doesn't tell us what needs solving.
The code block from line 36 to 52,is what i want to be activated once the ball i have hits something 10 times, without this the ball bounces forever.