Hey! This Should work.. but you need to do a couple of steps.
1.) First put a click detector inside of the part you want to go away.
2.) Then in insert a script inside of the part. And put this script inside. And your all set!
local sp = script.Parent
function DestroyBlock()
sp.Transparency = 0.1
wait()
sp.Transparency = 0.2
wait()
sp.Transparency = 0.3
wait()
sp.Transparency = 0.4
wait()
sp.Transparency = 0.5
wait()
sp.Transparency = 0.6
wait()
sp.Transparency = 0.7
wait()
sp.Transparency = 0.8
wait()
sp.Transparency = 0.9
wait()
sp:Destroy()
end
script.Parent.ClickDetector.MouseClick:Connect(DestroyBlock)
I added the Transparency to give it a very nice effect. Enjoy!
EDIT: If you didnt want the nice effect heres the simple script
function DestroyBlock()
script.Parent:Destroy()
end
script.Parent.ClickDetector.MouseClick:Connect(DestroyBlock)
2 comments
wait are you allowed to use MouseButton1Click on a part?
No. You have to have a clickDetector inside of the part and the script inside of the clickDetector. And inside of the script you cant use MouseButton1Click. MouseButton1Click only works inside of GUI's. Use script.Parent.MouseClick:connect(function(player) instead.