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

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

Asked by 8 years ago

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

script

01local Handle = script.Parent.Handle
02 
03local Explosion = script.Parent.Explosion
04 
05local Character = script.Parent.Parent.Parent.Character
06 
07local Active = 1
08 
09function onClick()
10    if Active == 1 then
11        local Bomb = Handle:Clone()
12        local Script = Explosion:Clone()
13        Bomb.Name = "Bomb"
14        Bomb.CanCollide = true
15        script.Parent = Bomb
View all 24 lines...
01wait(5)
02 
03local Explosion = Instance.new("Explosion")
04 
05local Blast = Instance.new("Sound")
06 
07Blast.SoundId = "rbxasset://sounds\\Rocketshot.wav"
08 
09Blast.Parent = Bomb
10 
11Blast.Volume = 1
12 
13Blast:Play()
14 
15Explosion.Parent = Bomb
View all 25 lines...
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. GoldenPhysics 474 — 8y

1 answer

Log in to vote
0
Answered by
cc567 50
8 years ago

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

Ad

Answer this question