Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make an explosion explode after a few seconds?

Hello. My goal is to make an explosion explode after about five seconds repeatedly, but I am having trouble doing so. I think I wrote the code sort of correctly, but I don't see the visual explosion. I don't want it to do any damage, I just want the visual effect to play every five seconds. Can somebody help?

while true do
	wait(5)
	explosion = Instance.new("Explosion")
	explosion.Parent = script.Parent
	explosion.ExplosionType = Enum.ExplosionType.Craters
	explosion.BlastRadius = 5
	wait(1)
	explosion:Destroy()
end


2 comments

0

You should say local explosion = Instance.new("Explosion") , and I believe you need BlastPressure aswell.

0

Thanks, I figured it out. I also forgot to set the position.

1 answer

✓ Accepted answer

you need to set all of the other settings before you set the parent. it explodes as soon as it enters the workspace, so you’re changing it while it is exploding.

also, Explosion:Destroy(). sounds a bit ironic doesn’t it? anyways, explosions actually delete automatically a little bit after they’re done so it’s not necessary.

This discussion is preserved as it was. New answers, comments, and votes are closed.