Jump to content

Script help...


DingleMcDonglic

Recommended Posts

So I'm creating an npc mod and I have one slight problem with a script!

 

Whenever the player enters radiation: the npc equips his helmet (good!)

 

But for some reason he will not remove the helmet once he exits the radiation (bad)

 

If some kind being would point out the flaw in my script I would be eternally grateful!!!

 

 

Begin gamemode

If aaaDarrenDukeID.bDarrenDukeHired != 1
Return
ElseIf Player.IsInCombat == 1
Return
elseif ((player.GetRadiationLevel > 1 )&&(bDarrenRadiation == 0))
if timer1 >= 3
set timer1 to timer1 + getsecondspassed
else
DarrenDukeREF.say aaaDarrenDukeRadiationState
set bDarrenRadiation to 1
DarrenDukeREF.additem aaaDarrenDukeRadHelmet 1
DarrenDukeREF.equipitem aaaDarrenDukeRadHelmet
DarrenDukeREF.resetai
set timer1 to 0
endif
if ((player.GetRadiationLevel < 1)&&(bDarrenRadiation == 1))
if timer2 >= 3
set timer2 to timer2 + getsecondspassed
else
DarrenDukeREF.say aaaDarrenDukeRadiationState
set bDarrenRadiation to 0
DarrenDukeREF.removeitem aaaDarrenDukeRadHelmet 1
set timer2 to 0
endif
endif
endif
endif
endif
end

 

thanks in advance

Link to comment
Share on other sites

Needs another elseif for the "remove helmet" section. Also remove a few endif's at the end. Use >= 1 for the first check, or <= 1 for the second check otherwise nothing will work if it's exactly one.
Begin gamemode


If aaaDarrenDukeID.bDarrenDukeHired != 1
   Return
ElseIf Player.IsInCombat == 1
   Return  
elseif ((player.GetRadiationLevel >= 1 )&&(bDarrenRadiation == 0))
    if timer1 >= 3
       set timer1 to timer1 + getsecondspassed
    else
          DarrenDukeREF.say aaaDarrenDukeRadiationState
          set bDarrenRadiation to 1
            DarrenDukeREF.additem aaaDarrenDukeRadHelmet 1
            DarrenDukeREF.equipitem aaaDarrenDukeRadHelmet
            DarrenDukeREF.resetai
           set timer1 to 0
    endif
elseif ((player.GetRadiationLevel < 1)&&(bDarrenRadiation == 1))
    if timer2 >= 3        
      set timer2 to timer2 + getsecondspassed
    else
            DarrenDukeREF.say aaaDarrenDukeRadiationState
           set bDarrenRadiation to 0
            DarrenDukeREF.removeitem aaaDarrenDukeRadHelmet 1
            set timer2 to 0
    endif


endif


end

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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