Jump to content

[LE] Help! Skyrim script


Recommended Posts

So I am making a mod that adds new weapons to the game, that are vanilla mash-up. I wanted to make a dremora npc spawn when the player reaches a certain level but I got
EOF error. Here is the code, please help

Scriptname RRHollowToggle extends ObjectReference
ObjectReference Property HollowDremoraProp Auto
If Game.GetPlayer().GetLevel() >= 50
HollowDremoraProp.Enable()
Endif
EDIT: I managed to get it working by adding a trigger box.
Edited by KOamiNE
Link to comment
Share on other sites

Your script is missing events. And yes.. I read you managed to get it working.

 

RRHollowToggleScript

 

Scriptname RRHollowToggleScript extends ObjectReference  
; https://forums.nexusmods.com/index.php?/topic/8276603-help-skyrim-script/
; KOamiNE wrote: "I managed to get it working by adding a trigger box."

  ObjectReference PROPERTY HollowDremoraProp auto        ; actor dropped to Skyrim by CK


; -- EVENTs --

EVENT OnTriggerEnter(ObjectReference triggerRef)
IF (triggerRef == Game.GetPlayer() as ObjectReference)
ELSE
    RETURN    ; - STOP -    something else is inside the trigger, not the player
ENDIF
;---------------------
    myF_Action(triggerRef as Actor)
ENDEVENT


;=================================
state Done
;=========
EVENT OnTriggerEnter(ObjectReference triggerRef)
ENDEVENT

EVENT OnCellDetach()    ; enable once only
    self.DisableNoWait()
    self.Delete()
ENDEVENT

;EVENT OnCellDetach()    ; enable multiple times
;    HollowDremoraProp.Disable()
;    gotoState("")                    ; ### STATE ###
;ENDEVENT
;=======
endState


; -- FUNCTION --

;--------------------------------
FUNCTION myF_Action(Actor player)
;--------------------------------
    IF (player.GetLevel() >= 50)
        gotoState("Done")            ; ### STATE ###
        HollowDremoraProp.Enable(TRUE)            ; player is level 50 or higher
    ENDIF
ENDFUNCTION

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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