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
Please, code blocks. Click the Blue Lua Icon and paste code in between the ~~~