If I have a pile of 9 daggers, the pile is destroyed but it seems it's recognized as only 1 object. I couldn't find any function that counts items stacked in a pile, but tried with .getitemcount, and it didn't work.
Any ideas ?
Here's the script :
Spoiler
Scriptname DestructItem extends ObjectReferenceformlist property destructool autoObjectReference property Target autoInt property MatNumb autoint property ItemCount autoMiscObject Property WeapMat AutoobjectReference property objSelf auto hiddenEvent OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)if destructool.hasform(akSource) if akAggressor==game.getplayer() objSelf= self as ObjectReference ;debug.messagebox(objSelf) ;debug.messagebox(objSelf.getactorowner()) ;debug.messagebox(objself.getfactionowner()) if objself.GetActorOwner()==none if objself.GetFactionowner()==none ;ItemCount=objself.getitemcount(objself.getbaseobject()) ;debug.messagebox(itemcount) game.getplayer().additem(WeapMat, (MatNumb*ItemCount)) objself.delete() else debug.notification("You can only destroy your items.") endif else debug.notification("You can only destroy your items.") endif endifendifendevent