Jump to content

Book-related question


Recommended Posts

You can add a simple script to your book to prevent taking:

 

Scriptname TM_PlayerNoTake extends ObjectReference

Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) 
    If akNewContainer == Game.GetPlayer() 
        If akOldContainer == None 
            Self.Drop()
        Else 
            akNewContainer.RemoveItem(Self, 1, True, akOldContainer) 
        Endif 
        
        Debug.Notification("Can't take this book.") 
    Endif 
EndEvent

Note, this will only work if your book object reference is placed in the world. If it starts inside a container, it won't have a reference and the script won't work.

Link to comment
Share on other sites

Thanks dylbill, much appreciated. I amended it slightly so that the book got placed back to its original position.

Scriptname MLS_PlayerNoTake extends ObjectReference
{Prevents the player from taking an item; script provided by dylbill via Nexus forums}

ObjectReference Property MLS_BiblesLocation Auto
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) 
    If akNewContainer == Game.GetPlayer() 
        If akOldContainer == None 
            Self.moveTo(MLS_BiblesLocation)
        Else 
            akNewContainer.RemoveItem(Self, 1, True, akOldContainer) 
        Endif 
        
        Debug.Notification("You can't take this book.") 
    Endif 
EndEvent
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...