Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What is wrong with my bomb script?

I have been making one of my first scripts a bomb. I want a giant sphere to expand from it and cause breakjoints to anyone who touches the sphere. Problem is there is no sphere and certainly no breakjoints.

function touch()
	wait(3)
end
script.Parent.Touched:connect(touch)

function onActivated()
	
	if not enabled then
		return
end
enabled = false

bombEffect()

Kill()

wait(10)
	
enabled = true

end

function bombEffect()
sphere = Instance.new("part")
local mesh = Instance.new("SpecialMesh")
mesh.MeshType = 3
mesh.Parent = sphere
sphere = Enum.Material.Metal
sphere.TopSurface = 0
sphere.BottomSurface = 0
sphere.LeftSurface = 0
sphere.RightSurface = 0
sphere.Size = Vector3.new(0,0,0)
sphere.CanCollide = false
sphere.Transparency = 0.5
shere.BrickColor = BrickColor.new(1,1,1)
sphere.Parent = game.Workspace
end

function Kill()
	children = {}
	recursiveGetChildren(game.Workspace)
	
	BreakJoints()
	
	Wait(10)
	bomb.GeneratingHole:Stop()
end

1 answer

Put the

function bombEffect()
sphere = Instance.new("part")
local mesh = Instance.new("SpecialMesh")
mesh.MeshType = 3
mesh.Parent = sphere
sphere = Enum.Material.Metal
sphere.TopSurface = 0
sphere.BottomSurface = 0
sphere.LeftSurface = 0
sphere.RightSurface = 0
sphere.Size = Vector3.new(0,0,0)
sphere.CanCollide = false
sphere.Transparency = 0.5
shere.BrickColor = BrickColor.new(1,1,1)
sphere.Parent = game.Workspace
end

Before the

bombEffect()
 
Kill()

Hope this helped :)

This discussion is preserved as it was. New answers, comments, and votes are closed.