Not enough endifs (you need one Endif per If). Plus, like Zumbs said you need to call GetAV RadiationRads on the player- currently it's checking to see if the
armour has more than 150 rads, which is pretty unlikely to happen.
I'd suggest sticking to the Equip if it works once you've fixed the conditions, and you'd need to add in a check to make sure the player isn't under the effects of RadAway (player.isspelltarget RadAway==0) to maintain compatibility with mods that alter radaway to be heal over time, otherwise the PC would chug their whole supply of radaway before it had time to kick in properly.
You can also check "Is not zero" using statements like if(GetItemCount RadAway), rather than if(GetItemCount RadAway != 0), as they're slightly faster.
For an example:
if(player.getAV RadiationRads > 150) if (player.isSpellTarget RadAway) ;Do nothing until it's finished applying elseif(player.GetItemCount RadAway) player.EquipItem RadAway 1 endifendif
thanks a TON! that works like a charm, but applying the same method to a stimpak doesn't seem to work out. this is what I worked out from what you posted, but it doesn't seem to trigger
if player.GetHealthPercentage < 0.50 if player.isSpellTarget Stimpak ;Do nothing until it's finished applying elseif player.GetItemCount Stimpak player.EquipItem Stimpak endif endif
I tested a message in the health check part and it's fine, so it's just an issue with the application of the stimpak. I read somewhere that there's a built in check if you are in the menu (pipboy) and have to exit before it's applied. Any idea on a work around?
I went with GetHealthPercentage instead of GetAV.Health because that seems to be an absolute value, which would varry substantially from player to player, as well as through the levels.
if I remove the "if player.isSpellTarget Stimpak", it does spam the application of stimpaks, but never actually adds any health from it
I also notived the "1" after equipping the aid of choice is not needed, being that that would set it as unequippable.
EDIT: ok, my bad... in a previous attempt on the script I appearantly burned through my entire stock of stimpaks, so spent 1/2 the day trying to find out what was wrong, only to find out I was out of stimpaks -_-.........
the above script segment works fine :facepalm: