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

How do I make an explosion kill players but not damage the environment?

Asked by
SuperFryX 130
8 years ago

How do I make an explosion kill players but not damage the environment? My game relies on some explosions, but there are so many important unanchored joints I have in it, that the explosions keep messing it up.

0
Try reducing the BlastRadius property to 1. This will result in the killing the player if the explosion were to occur on the player, and should prevent harming the environment. Another option would be making BlastRadius 0 and using magnitude to determine if a player is in range of an explosion. M39a9am3R 3210 — 8y

1 answer

Log in to vote
2
Answered by 8 years ago

Every explosion has a value that effects how the explosion interacts with the terrain. There are two ways to read and write this value but its easier to reference using numbers:

Explosion.ExplosionType = 0 --NoCraters; NO MESS!
Explosion.ExplosionType = 1 --Craters(no debris); Creates a hole in surrounding terrain
Explosion.ExplosionType = 2 --Craters and Debris;Creates a hole along with broken terrain pieces.

Hope this helped.

0
Does this only work with terrain? SuperFryX 130 — 8y
0
I don't work with explosions often so I'm no expert but, for non terrain enviroment it may need to be anchored. You may also be able to use a cframe weld. Correct me if I am wrong. AZDev 590 — 8y
Ad

Answer this question