TheReapersMetalworks Posted December 31, 2019 Share Posted December 31, 2019 (edited) 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 gotEOF error. Here is the code, please help Scriptname RRHollowToggle extends ObjectReference ObjectReference Property HollowDremoraProp Auto If Game.GetPlayer().GetLevel() >= 50HollowDremoraProp.Enable()Endif EDIT: I managed to get it working by adding a trigger box. Edited December 31, 2019 by KOamiNE Link to comment Share on other sites More sharing options...
ReDragon2013 Posted January 1, 2020 Share Posted January 1, 2020 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 More sharing options...
TheReapersMetalworks Posted January 4, 2020 Author Share Posted January 4, 2020 Thank you for your reply. This will be very helpful for my future projects. :) Link to comment Share on other sites More sharing options...
Recommended Posts