Basically what I'm trying to do:
- A chest has a script attached which has OnItemAdded/OnItemRemoved events.
- I need to be able to determine what type of object is placed in the chest (specifically if it's a weapon, armor or anything else).
This is my "best" attempt so far but it fails. It will never say Weapon! or Armor! no matter what I put in the chest...
Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)if (akSourceContainer == Game.GetPlayer()) Debug.MessageBox("The player game me " + aiItemCount + "x " + akBaseItem) if (akItemReference.GetBaseObject() as Weapon) Debug.MessageBox("Weapon!") endIf if (akItemReference.GetBaseObject() as Armor) Debug.MessageBox("Armor!") endIfendIfendEvent
