I'm making an effect on this part as if it were being shatteed:
function onClicked(Player)
script.Parent.Crack1.Visible=true
wait(0.4)
script.Parent.Crack2.Visible=true
wait(0.4)
script.Parent. Destroy()
wait(0.1)
Button=script.Parent.Parent.Parent.StarterGui.ScreenGui.Button1
if Button.Text=>0 then
Button.Text.+1
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
Im having some trouble with this can you help?
The button is for an Inventory GUI that shows how much of this material has been mined, The Crack 1 and Crack 2 are for an animation to see the block seemingly cracking. Will the button Text work??

3 comments
Please accept my answer if I helped with your problem :)
You missed an error on line 10.
Thanks Perci1 I didn't see that.