1 | while true do |
2 | explosion = Instance.new( "Explosion" ) |
3 | explosion.BlastPressure = 10000 |
4 | explosion.BlastRadius = 50 |
5 | explosion.DestroyJointRadiusPercent = . 3 |
6 | explosion.Position = (math.random),(math.random),(math.random) |
7 | wait(math.random( 1 , 8 )) |
8 | end |
I want it to generate random explosions everywhere with these traits. I need help, and was wondering if one of you guys could help.
01 | local waitTime = 1 -- Every 1 second the script will repeat again. Change to what you want. |
02 |
03 | while wait() do |
04 | wait(waitTime) |
05 | local part = Instance.new( "Part" ,game.Workspace) |
06 | part.Position = Vector 3. new(math.random(- 300 , 300 )),(math.random(- 300 , 300 )),(math.random(- 300 , 300 )) |
07 | part.Anchored = true |
08 | part.Transparency = 1 |
09 | part.CanCollide = false |
10 | local Explosion = Instance.new( "Explosion" ,part) |
11 | Explosion.BlastPressure = 10000 |
12 | Explosion.BlastRadius = 50 |
13 | Explosion.Position = part.Position |
14 | ExplosionType = "CratersAndDebris" |
15 | wait( 1 ) |
16 | part:Destroy() |
17 | Explosion:Destroy() |
18 | end |
1 | while true do |
2 | explosion = Instance.new( "Explosion" ) |
3 | explosion.BlastPressure = 10000 |
4 | explosion.BlastRadius = 50 |
5 | explosion.DestroyJointRadiusPercent = . 3 |
6 | explosion.Parent = workspace |
7 | explosion.Position = Vector 3. new( (math.random),(math.random),(math.random)) |
8 | wait(math.random( 1 , 8 )) |
9 | end |
Change the math.randoms to math.random(x,y) with x being the minimum number and y being maximum.