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
wait(10)
print("Explode starts in 5 secs")
wait(5)
print("Boom!")
wait(1)
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
end
wait(20)
print("smoke cleared out")
part:Destroy() -- this part is where I struggle with because not all sorrounding parts get deleted.
end)
e.Parent = workspace
print("Explode, success!")
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)
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?