What is best way to create explosions in multiple directions?

  1. What do you want to achieve? I want to create an explosion in multiple directions at same time.

  2. What is the issue? My current script works but not as efficiently as I would like. Using wait before each explosion and the position seems to go much farther than 1 stud when using * Vector3.new (1,0,0) So Im using + Vector3.new (1,0,0) instead and this doesnt seem to make it 1 stud per number.

  3. What solutions have you tried so far? I tried using particles instead which I prefer to use but didn’t get it working. I didn’t find a similar topic.

local Bomb = script.Parent
local Number = Bomb.Num.Value
local function customExplosion(position)
	local explosion = Instance.new ("Explosion")-- game.ServerStorage.Clones.Ex.Explosion:Clone()
	explosion.Parent = Bomb
	explosion.Position = Bomb.Position 
	explosion.Visible = true
	wait(0.001)
	explosion.Parent = Bomb
	explosion.Position = Bomb.Position + Vector3.new(10,0,0)
	explosion.Visible = true
	wait(0.001)
	explosion.Parent = Bomb
	explosion.Position = Bomb.Position + Vector3.new(-10,0,0)
	explosion.Visible = true
	wait(0.001)
	explosion.Parent = Bomb
	explosion.Position = Bomb.Position + Vector3.new(0,0,10)
	explosion.Visible = true
	wait(0.001)
	explosion.Parent = Bomb
	explosion.Position = Bomb.Position + Vector3.new(0,0,-10)
	explosion.Visible = true
	wait(0.001)
	if Number >=1 then
		
		explosion.Parent = Bomb
		explosion.Position = Bomb.Position + Vector3.new(20,0,0)
		explosion.Visible = true
		wait(0.001)
		explosion.Parent = Bomb
		explosion.Position = Bomb.Position + Vector3.new(-20,0,0)
		explosion.Visible = true
		wait(0.001)
		explosion.Parent = Bomb
		explosion.Position = Bomb.Position + Vector3.new(0,0,20)
		explosion.Visible = true
		wait(0.001)
		explosion.Parent = Bomb
		explosion.Position = Bomb.Position + Vector3.new(0,0,-20)
		explosion.Visible = true
		
	end
	
end
wait(3)
customExplosion()

any help is appreciated!

1 Like

You can do this in one or more for loops. You just need an expression for the positions of each explosion.

1 Like

Are you just trying to get the visual explosion to go in different directions? If it isn’t just for visual you can use the BlastRadius parameter to strike things in all directions. Also when multiplying a Position by a vector it multiplies each value so * Vector3.new(1,0,0) would keep the X value as it is and set both Y and Z to 0 which would be somewhere near the center of the world plus your X value. When you are doing + Vector3.new(1,0,0) you are just increasing the X value by 1 stud.

1 Like