; --------------------------------------------- ; ReadOnLoot.psc - by kinggath ; --------------------------------------------- ; Reusage Rights ------------------------------ ; You are free to use this script or portions of it in your own mods, provided you give me credit in your description and maintain this section of comments in any released source code (which includes the IMPORTED SCRIPT CREDIT section to give credit to anyone in the associated Import scripts below. ; ; IMPORTED SCRIPT CREDIT ; N/A ; --------------------------------------------- Scriptname ReadOnLoot extends ObjectReference ; --------------------------------------------- ; Editor Properties --------------------------- ; --------------------------------------------- Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) ObjectReference PlayerRef = Game.GetPlayer() if(akNewContainer == PlayerRef) ObjectReference noteRef = PlayerRef.PlaceAtMe(Self.GetBaseObject(), 1, false, true) if(noteRef) int iPlayerHas = PlayerRef.GetItemCount(Self.GetBaseObject()) noteRef.Activate(PlayerRef) ; Display as note noteRef.Delete() ; Remove the reference ; Wait until player exits the activated note Utility.Wait(0.1) if(iPlayerHas < PlayerRef.GetItemCount(Self.GetBaseObject())) ; Prevent duplication if player hit the Take option after activating the temporary version PlayerRef.RemoveItem(Self.GetBaseObject(), 1, true) endif endif endif EndEvent