Thanks everyone! I tried out both of these suggestions.
A method I have used to track wear on an item (lock picks used in an unconventional way) is to check Random100 for a possible chance of breaking (for me 20 uses per pick therefore 5% chance of breaking). Then I removed the item with a message explaining it was broken. I like the realistic uncertainty of when the item will be worn out. If you prefer an absolute number of uses, then you could have a counter keep track of the number of uses and then 'break it'. The challenge would be in either case to know when the player is using the item. Perhaps you could check for the sound of the pick striking the rock when it is equipped by the player.
The original script does indeed check for the sound of the weapon swing, so that part's been taken care of for me. Using the random counter, this method works well. The only thing I think it's missing is that you can't repair the pick after mining a bit.
I think you would need a NPC/creature as container to hit. A setparalysis 1 / skipanim invisible race NPC dressed with a rock mesh, or a minimal animation rock creature similar to some training dummy creature could do.
This seems like it would work really well. I modified the script to check for OnPCHitMe rather than the sound of the weapon swing,
but for some reason after a random number of hits hits it now skips over to the end of the script where the rock is mined out and disappears (displays messagebox "There's nothing more to get from this rock" and then disables). The NPC will no longer provide random gems but it doesn't disappear after the first hit so I'm confused as to what happened. If you'd like to look at the scripts, here's the original one that worked for the rock as a container:Nevermind, turns out I forgot to add any diamonds to the NPC's inventory
. Now I've just got to adjust the models so they're not floating over the original rocks. This is a long shot, but is there a way to stop the bleeding texture from appearing?