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

Part doesnt explode when clicked?

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

✓ Accepted answer

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

2 comments

0

Thanks and why do we need to put "explosionPart.Parent=nil'?

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

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