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

Part doesnt explode when clicked?

Asked by 5 years ago
Edited 5 years ago

When I click Part 1 it should explode Part 2 but when I click Part 1 , Part 2 explodes but it is still there it does not disappear. It exploded me when I was near it but it doesnt explode it self.

script.Parent.ClickDetector.MouseClick:Connect(function() local explosionPart = game.Workspace.Part2 local explosion = Instance.new("Explosion",game.Workspace.Part2) explosion.Position = explosionPart.position end)

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

I think you need to destroy the part on your own. Meaning that at the end add

wait()
explosionPart:Destroy()
explosionPart = nil

https://developer.roblox.com/en-us/api-reference/function/Instance/Destroy

0
Thanks and why do we need to put "explosionPart.Parent=nil'? RebornedSnoop 175 — 5y
0
Sorry I will correct its suppose to be explosionPart = nil. On the Roblox developer site(will link at end) it give an example of the variable where the destroyed part was held can still be referenced. https://developer.roblox.com/en-us/api-reference/function/Instance/Destroy JoshChubi 74 — 5y
Ad

Answer this question