I am trying to make a bomb that makes a huge ball which expands and kills all players that touch it. I have tried changing everything yet I don't even get a signal that anything is working
function onTouch()
if not enabled then
return
end
enabled=false
bombEffect(bomb)
kill()
wait(5)
enabled = true
end
script.Parent.Touched:connect(onTouch)
function bombEffect(bomb)
sphere = Instance.new("part")
local mesh = Instance.new("SpecialMesh")
mesh.Meshtype = 3
mesh.Parent = sphere
sphere = Enum.Materials.Metal
sphere.TopSurface = 0
sphere.BottomSurface = 0
sphere.LeftSurface = 0
sphere.RightSurface = 0
sphere = Vector3.new(0, 0, 0)
sphere.CanCollide = false
sphere.Transparency = 0.5
sphere.BrickColor = BrickColor.new(1, 1, 1)
sphere.Parent = game.Workspace
end
function kill()
children = {}
recursiveGetChildren(game.Workspace)
script.Parent:BreakJoints()
end
script.Parent.Touched:connect(kill)
function recursiveGetChildren(parent)
local kids = parent:GetChildren()
if kids ~= nil then
for i =1, #kids do
table.insert(children,kids[i])
recursiveGetChildren(kids[i])
end
end
end
