DingleMcDonglic Posted August 24, 2015 Share Posted August 24, 2015 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 ReturnElseIf Player.IsInCombat == 1Return elseif ((player.GetRadiationLevel > 1 )&&(bDarrenRadiation == 0)) if timer1 >= 3 set timer1 to timer1 + getsecondspassedelse DarrenDukeREF.say aaaDarrenDukeRadiationStateset 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 endifendifendif endif end thanks in advance Link to comment Share on other sites More sharing options...
rickerhk Posted August 24, 2015 Share Posted August 24, 2015 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 More sharing options...
DingleMcDonglic Posted August 24, 2015 Author Share Posted August 24, 2015 Thanks once again lol Link to comment Share on other sites More sharing options...
Recommended Posts