Just deleting the object and replacing it with a new one won't be what you want done. You're going to want a timer to change the object for a certain amount of time (to a mined rock) and then change back to a mine-able rock again.
here you go mate -
https://www.rune-server.ee/runescape...er-mining.html