Jump to content

[LE] Giveing necklace costum properties when worn


Recommended Posts

You need to put this script in the necklace, if it is a custom an only one will be use you can edit base an insert the script there, but you should know that all other instances of this object that you will place in your mod will also have it, if you don't want that, then insert the script in the "Object Reference Window Property" in "Scripts".

 

 

Event OnEquipped(Actor akActor)
     if akActor == Game.GetPlayer()
        Game.GetPlayer().StartSneaking()
  EndIf
EndEvent

 

 

Edited by maxarturo
Link to comment
Share on other sites

in addition to good posting of maxarturo, make sure your script has an unique name

 

bendiNecklaceScript

 

Scriptname bendiNecklaceScript extends ObjectReference
; https://forums.nexusmods.com/index.php?/topic/8137108-giveing-necklace-costum-properties-when-worn/

; -- EVENTs -- 3
; https://www.creationkit.com/index.php?title=StartSneaking_-_Actor

EVENT OnInit()
    Debug.Trace("OnInit() - has been reached.. " +self)            ; debugging only
ENDEVENT


EVENT OnEquipped(Actor akActor)
IF (akActor == Game.GetPlayer())
ELSE
    RETURN    ; - STOP -    not equipped by player
ENDIF
;---------------------
IF akActor.IsSneaking()
ELSE
    ; will nott work if the actor is falling, swimming, or in the middle of performing an attack at the time it is called.
    akActor.StartSneaking()                ; start player sneaking
ENDIF
ENDEVENT


EVENT OnUnEquipped(Actor akActor)
IF (akActor == Game.GetPlayer())
ELSE
    RETURN    ; - STOP -    not unequipped by player
ENDIF
;---------------------
IF akActor.IsSneaking()
    akActor.StartSneaking()                ; player is already sneaking cancel sneaking
ENDIF
ENDEVENT

 

 

Edited by ReDragon2013
Link to comment
Share on other sites

  • Recently Browsing   0 members

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