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

Exploding Part After Running Effects?

So I am trying to have an item (when moved) run sound effects and particle effects then explode. I've written this but nothing happens:

local explosionDynamite = script.Parent local smokeEffect = game.Workspace.ShopItems.TestShop.Dynamite.Main.Smoke local sparklesEffect = game.Workspace.ShopItems.TestShop.Dynamite.Main.Sparkles local fuseSoundEffect = game.Workspace.ShopItems.TestShop.Dynamite.Main.Fuse local explosionSoundEffect = game.Workspace.ShopItems.TestShop.Dynamite.Main.Explosion

while explosionDynamite.Velocity < 0.1 do wait()

local function runExplosion() fuseSoundEffect smokeEffect wait(1) sparklesEffect explosionSoundEffect wait(1) end end

local explosion = Instance.new("Explosion", game.Workspace) explosion.Position = explosionDynamite.Position explosionDynamite:Destroy()

How do I make it work? I want the item to explode after doing the effects when it is moved...

1 comment

0

Please, code blocks. Click the Blue Lua Icon and paste code in between the ~~~

1 answer

local explosionDynamite = script.Parent
local smokeEffect = game.Workspace.ShopItems.TestShop.Dynamite.Main.Smoke
local sparklesEffect = game.Workspace.ShopItems.TestShop.Dynamite.Main.Sparkles
local fuseSoundEffect = game.Workspace.ShopItems.TestShop.Dynamite.Main.Fuse
local explosionSoundEffect = game.Workspace.ShopItems.TestShop.Dynamite.Main.Explosion

while explosionDynamite.Velocity < 0.1 do
wait()

local function runExplosion() fuseSoundEffect smokeEffect
wait(1)
sparklesEffect
explosionSoundEffect
wait(1)
end
end

local explosion = Instance.new("Explosion", game.Workspace)
explosion.Position = explosionDynamite.Position
explosionDynamite:Destroy()

1 comment

0

This is the code(not fixed up)

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