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

How to make it so parts will not be affected by an explosion?

Asked by 6 years ago
Edited 6 years ago

I made a landmine script, but the thing I don’t want from the explosion is affecting things other than players, such as bricks. I actually have no clue how to detect which object will be blasted off and which ones won’t be affected. Does anyone know what may help? Here’s the script.

01button = script.Parent
02bottom = script.Parent.Parent.Bottom
03explosionSound = script.Parent.ExplosionSound
04beep = script.Parent.Beep
05function Explode()
06beep:Play()
07wait(.6)
08explosionSound:Play()
09ex = Instance.new("Explosion")
10ex.BlastPressure = 300000
11ex.BlastRadius = 10
12ex.Position = script.Parent.Position
13ex.Parent = game.Workspace
14script.Parent.End.Disabled = false
15script.Disabled = true
16end
17script.Parent.Touched:Connect(Explode)

1 answer

Log in to vote
1
Answered by 6 years ago

DestroyJointRadiusPercent is the amount of damage to bricks near it after the explosion. It will destroy joints far as depending on the range.

button = script.Parent
bottom = script.Parent.Parent.Bottom
explosionSound = script.Parent.ExplosionSound
beep = script.Parent.Beep
function Explode()
beep:Play()
wait(.6)
explosionSound:Play()
ex = Instance.new(“Explosion”)
ex.BlastPressure = 300000
ex.BlastRadius = 10
ex.DestroyJointRadiusPercent = 0
ex.Position = script.Parent.Position
ex.Parent = game.Workspace
script.Parent.End.Disabled = false
script.Disabled = true
end
script.Parent.Touched:Connect(Explode)

Ad

Answer this question