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

My explosion isn't exploding?

Asked by 3 years ago

I don't understand what I'm doing wrong, I created a bomb that explodes and it works except for one thing. The explosion itself just doesn't work, it doesn't explode even though I destroyed it and set its position. Please do help.

01local TimeF = math.random(1)
02local Intermission = workspace.Elevator["Elevator Door"].OpenandClose.Intermission
03 
04wait(10)
05Intermission.Changed:Connect(function()
06    if Intermission.Value == 1 then
07        script.parent.Floors.Value += 1
08        if script.parent.Floors.Value == TimeF then
09            local explosionPart = script.parent.base
10            local explosion = Instance.new("Explosion",game.Workspace)
11            explosion.Position = explosionPart.Position
12            explosion.Visible = true
13            explosion.DestroyJointRadiusPercent = 1
14            explosion.BlastRadius = 4
15            explosion.BlastPressure = 500000
View all 25 lines...

1 answer

Log in to vote
1
Answered by 3 years ago
Edited 3 years ago

Add a wait between the setting the explosion's values and the explosion:Destroy() you instantly destroy it after it happens, it has no time at all.

01local TimeF = math.random(1)
02local Intermission = workspace.Elevator["Elevator Door"].OpenandClose.Intermission
03 
04wait(10)
05Intermission.Changed:Connect(function()
06    if Intermission.Value == 1 then
07        script.parent.Floors.Value += 1
08        if script.parent.Floors.Value == TimeF then
09            local explosionPart = script.parent.base
10            local explosion = Instance.new("Explosion",game.Workspace)
11            explosion.Position = explosionPart.Position
12            explosion.Visible = true
13            explosion.DestroyJointRadiusPercent = 1
14            explosion.BlastRadius = 4
15            explosion.BlastPressure = 500000
View all 26 lines...
Ad

Answer this question