Script attached to an Axe placed in a cell in the CK:
Int MyIntegerEvent OnActivate(ObjectReference akActionRef) BlockActivation() if akActionRef == Game.GetPlayer() if Game.GetPlayer().IsSneaking() Debug.MessageBox("MyInteger = "+MyInteger) Utility.Wait(1.0) MyInteger += 1 Return else Game.GetPlayer().AddItem(self) Return endif endifEndEvent
I tested by repeatadly activating the Axe whilst sneaking and the Integer increased as intended. After a few goes I'd add the Axe to my inventory, then remove it, and when acitvating again whilst sneaking the variable held true to the previous number. I tested also saving and loading and the variable stuck.
Is my understanding not right with this? I thought the ObjectReference needed to be held in a property somewhere in order to have it's variables persist... or is it working for me because this isn't an Axe with an FF form ID?