Mod:Creation Kit/OnContainerChanged - ObjectReference

Member of: Mod:Creation Kit/ObjectReference Script

Event called when the object reference enters/leaves/moves between containers.

Syntax
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)

Parameters

 * akNewContainer: The container this object is entering. If this is None, the object was dropped.
 * akOldContainer: The container this object just left. If this is None, the object was picked up.

Examples
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) if akOldContainer && !akNewContainer Debug.Trace("We have been dropped!") elseif akNewContainer && !akOldContainer Debug.Trace("We have been picked up!") else Debug.Trace("We have switched containers!") endIf endEvent Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) if akNewContainer == Game.GetPlayer Debug.Trace("I just got put in the player's inventory!") endIf endEvent