I'm trying to create some enchanted containers. I have several working just fine, however I have one that I want to limit the number of items that can be added.
There are two components, the "Purse" which the player carries in his/her inventory and a container in a hidden cell (much like a vendor chest)
<< Script on the Coin Purse, this portion works fine>>
Scriptname aaCH18_ContainerManager extends ObjectReference
ObjectReference Property aaCh18Container Auto
MiscObject Property ContainerObj Auto
Event OnEquipped(Actor akActor) ;when the bucket is equipped...
Game.DisablePlayerControls(false, false, false, false, false, true, false)
utility.wait(0.1)
Game.EnablePlayerControls(false, false, false, false, false, true, false)
utility.wait(0.5)
aaCh18Container.Activate(Game.GetPlayer()) ;...open the trash container
EndEvent
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
If akNewContainer == aaCh18Container
aaCh18Container.RemoveItem(ContainerObj)
Debug.Notification("The Container can't contain itself.")
EndIf
EndEvent
- <