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

Why wont my bomb script work I tried putting dofferent wait times a booleans why wont it work?

I am trying to make an exploding bomb and it wont work the bomb wont explode it just drops

script

local Handle = script.Parent.Handle

local Explosion = script.Parent.Explosion

local Character = script.Parent.Parent.Parent.Character

local Active = 1

function onClick()
	if Active == 1 then
		local Bomb = Handle:Clone()
		local Script = Explosion:Clone()
		Bomb.Name = "Bomb"
		Bomb.CanCollide = true
		script.Parent = Bomb
		script.Disabled = false
		Bomb.Parent = game.Workspace 
		Bomb.Position = Character.Torso.Position + Vector3.new(0,0,2)
		wait(5)
		Active = 1
		
	end
end
script.Parent.Activated:connect(onClick) -- this whole script makes a bomb drop
wait(5)

local Explosion = Instance.new("Explosion")

local Blast = Instance.new("Sound")

Blast.SoundId = "rbxasset://sounds\\Rocketshot.wav"

Blast.Parent = Bomb

Blast.Volume = 1

Blast:Play()

Explosion.Parent = Bomb

Explosion.Position = Bomb.Position

Explosion.BlastRadius = 10

Explosion.BlastPressure = 10000000

wait()

Bomb:Remove() -- all the explosion settings

1 comment

0

First, :Remove() is deprecated. Use :Destroy() instead. Second, you probably meant to use Script (capital S) instead of script on lines 15 and 16. That's a bad variable name anyways, so you should probably use something like explosionScript.

1 answer

For your Character variable, use Character = game.Players.LocalPlayer instead.

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