Script for a piece of gold or sand to fall out when breaking sand with certain shovels with a 50% chance
on break of sand:
if player's tool is wooden shovel or stone shovel or iron shovel or gold shovel:
cancel event
set {_chance} to a random integer between 1 and 100
if {_chance} <= 50:
drop 1 gold nugget at location of block
else:
drop 1 sand at location of block
remove block
The error is that the sand is not removed from the place, here is the video: