Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What is wrong with my bomb script?

Asked by 10 years ago

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

Log in to vote
0
Answered by 10 years ago

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 :)

Ad

Answer this question