The Custom Explosion module does exactly what the name would suggest: it allows you to easily make custom explosion effects that act like normal explosions. Getting started requires very little scripting experience, but advanced users can still create more advanced explosion effects and behaviors.
Features
Create custom explosion effect templates without writing a single line of code
Detect hits and destroy the environment just like regular Explosion instances
Define custom behaviors for effects
How to use
Every custom explosion object created using this module is based on an explosion template. A template is essentially a folder containing the required effects such as Particle Emitters, Lights and Sounds. Creating templates does not necessarily require any scripting knowledge.
To create an explosion template, follow the steps below:
Create a new Folder inside the Templates folder.
Give the new Folder a unique name.
Insert the effects (Particle Emitters, Lights etc.) to the new Folder.
To create a basic explosion, the following steps are required:
Require the CustomExplosion module from a script.
Create a new Explosion with CustomExplosion.new(“Your template name here”)
Set the Explosion’s position with Explosion:SetPosition()
Set the Explosion’s parent to workspace with Explosion:SetParent(workspace)
For more advanced behaviors such as sound effects before the explosion happens and hit detection, refer to the documentation bundled with the module.
hey mate, amazing module! however I’m having problems with it, I’m using this module so i can make explosions that can damage.
the documentation within the module didn’t give examples on how to damage a player using it, and there is another paramater that wasn’t in the documentation either. that being distance. upon using the Hit function it doesn’t damage any players. as shown here (https://gyazo.com/64f07909e63d89659ccd3f713f88c293)
is there also be a paramater that i can set that will check if it can destroy blocks?
local c2
c2 = newExplosion.Hit:Connect(function(hit,dist)
if hit.Parent:FindFirstChild("Humanoid") then
print(".......................")
if dist < 30 then
fxmod.TakeDamage(Character,hit.Parent,8,100)
end
end
c2:Disconnect()
end)
I looked at your code and tested it in-game with the assumption that fxmod.TakeDamage() is the equivalent to Humanoid:TakeDamage(). It worked the way it should, so assuming there’s nothing wrong with the fxmod.TakeDamage() function, you’re probably using a BlastRadius that’s too small. You can set this with newExplosion.ExplosionInstance.BlastRadius = x.
As for the parameter you asked about, you can simply create one yourself with newExplosion.CanDestroyParts = true and then checking if said attribute exists with
if newExplosion.CanDestroyParts then
-- Do something
end
Finally, I’ve updated the model. The documentation now mentions the distance parameter of the Hit event, I had completely forgotten it exists when I made this.
Yes, creating the explosion templates doesn’t require anything but putting particle emitters and other effects in a folder. Making these templates appear as explosions in-game does require a bit of scripting.
fxmod is my main module, i handle things there like player damage, healing, vfx, mesh-related stuff and a lot more. However I’ve already fixed my problem with TenX29’s post as well as tinkering with the module.
I have the same issue. I don’t want it to damage or kill the player at all but I can’t find anywhere in the documentation how to do this and I can’t find anything that does damage to the player in the module either.
Edit: Looks like I found out how to do it, I’m not sure about doing a certain amount of damage though. I’m pretty sure with this you can either turn damage off entirely or have it kill the player
local NewExplosion = Exposion.new("Example2")
NewExplosion.ExplosionInstance.BlastRadius
NewExplosion.ExplosionInstance.BlastPressure
NewExplosion.ExplosionInstance.DestroyJointRadiusPercent
is there an event that gets triggered when exploding? I don’t want the explosion to break the map, but I also want it to damage the players around it.
I have no idea why, but when explosion is created, only light and sound get enabled, but not the particle emitters.
No errors or anything, output is clear.