Explosion effect help

This is an attempt to make explosion with the explosion.hit:Connect(function(part,distance))
and applied smoke w every part,( I can’t upload the MP4 version)
robloxapp-20200920-1731362.wmv (3.4 MB)

is there any way to make it into a region3 function to make it reliable?
here’s the code i made

print("Explode starts in 5 secs")
local e = Instance.new("Explosion")
local s = Instance.new("Sound")
s.SoundId = "rbxassetid://440431180"
s.PlaybackSpeed = .75
s.Volume = 5
s.MaxDistance = 30000
s.PlayOnRemove = true
s.Parent = e

e.BlastPressure = 400000
e.BlastRadius = 80
e.Position = script.Parent.Position
e.Hit:Connect(function(part, distance)
	if part.ClassName == "Part" then
		local ExpAnim = game.ServerStorage.Smoke:Clone()	
		ExpAnim.Parent = part	
	print("smoke cleared out")
	part:Destroy() -- this part is where I struggle with because not all sorrounding parts get deleted.

e.Parent = workspace
print("Explode, success!")
1 Like

you cannot put the sound in the explosion. you have to put it in the workspace, then set it’s position.

Also, you always have to set the parent LAST do not put it anywhere else. Set the Parent after

e.Position = script.Parent.Position

For the video I recommend using a free open source screen recording software like, ShareX for windows or Kap for Mac, then uploading it onto imgur or streamable (makes it a lot nicer for those viewing, will also attract you more help and attention)

Well you could create a region3 centered at the hit location, then use the Find Parts in Region 3 Function of workspace to find the parts needed to be destroyed.

However, it may be easier to use the rotatedregion3 Module, since you can place a sphere part at the explosion center and use that as a region 3 to find parts within it:

However, I wonder why it’s unreliable though any explanations?

But sound doesnt have a position?

and also the order should be?

e.Parent = workspace
e.Position = script.Parent.Position -- It's parent is the exploding Part
1 Like