NPC Code:
if (weaponfired) {this.result=random(1,100)
if (this.result<=20 && this.result>=10) {
message Iron Found;
}
else if (this.result<=50) {
message Nothing Found;
}
if (this.result<=10) {message You should not have mining on your server, try something original;player.trysomethingelse++}
Something like that.