jazzisparis Posted September 9, 2014 Share Posted September 9, 2014 (edited) ref rCont short bEquipped begin OnEquip set rCont to GetContainer set bEquipped to 1 end begin OnUnequip set bEquipped to 0 end begin GameMode if bEquipped == 0 elseif rCont.GetHealthPercentage < 0.4 set bEquipped to 0 DropMe endif end Edited September 9, 2014 by jazzisparis Link to comment Share on other sites More sharing options...
Ladez Posted September 9, 2014 Share Posted September 9, 2014 (edited) Use GetEquipped as suggested by Hemingway. For the other thing, try setting Drops count parameter to 1. ref Wearer ref rMe float fHealthPercent float fTimer Begin OnAdd let Wearer := GetContainer let rMe := GetSelf ; * if that doesn't work, use the name of the hat End Begin GameMode let fTimer += GetSecondsPassed if fTimer < 1 ; * run at most once per second return endif let fTimer := 0 if Wearer.GetEquipped rMe != 1 return endif let fHealthPercent := (Wearer.GetAV "Health") / Wearer.GetBaseHealth if fHealthPercent < 0.4 Wearer.Drop rMe 1 endif End You'll have to wait for the new NVSE :wink:.Sounds exciting :wink: Edited September 9, 2014 by Ladez Link to comment Share on other sites More sharing options...
Hemingway308 Posted September 9, 2014 Share Posted September 9, 2014 Use GetEquipped as suggested by Hemingway. For the other thing, try setting Drops count parameter to 1.... Actually, I'd suggest going with jazzisparis' suggestion, its a lot neater. I thought I remembered DropMe and GetHealthPercentage being functions, but couldn't see them in NVSE... because they're in vanilla :pinch: Link to comment Share on other sites More sharing options...
bioshards Posted September 10, 2014 Author Share Posted September 10, 2014 jazz's script only works on the player ref rCont short bEquipped begin OnEquip set rCont to GetContainer set bEquipped to 1 end begin OnUnequip set bEquipped to 0 end begin GameMode if bEquipped == 0 elseif rCont.GetHealthPercentage < 0.4 set bEquipped to 0 DropMe endif end this script only works on the player, ill use hemingway's script but replace the last part with dropme and see if the result is satisfactory Link to comment Share on other sites More sharing options...
Ladez Posted September 10, 2014 Share Posted September 10, 2014 Have you tested it? Cause it doesn't look to me like it's player restricted. Link to comment Share on other sites More sharing options...
bioshards Posted September 10, 2014 Author Share Posted September 10, 2014 Have you tested it?i spawned doc michelle with a suave gambler's hat with the script on it. and i was wearing the same hat. i dropped the hat when i died but doc didnt Link to comment Share on other sites More sharing options...
bioshards Posted September 10, 2014 Author Share Posted September 10, 2014 (edited) nvm Edited September 10, 2014 by bioshards Link to comment Share on other sites More sharing options...
bioshards Posted September 10, 2014 Author Share Posted September 10, 2014 (edited) nvm Edited September 10, 2014 by bioshards Link to comment Share on other sites More sharing options...
bioshards Posted September 10, 2014 Author Share Posted September 10, 2014 (edited) any idea what might be wrong with this script? its not savingscn AAAhemingway ref Wearer ref rMe float fHealthPercent float fTimer Begin OnAdd let Wearer := GetContainer let rMe := GetSelf End Begin GameMode let fTimer += GetSecondsPassed if fTimer < 1 return endif let fTimer := 0 if Wearer.GetEquipped rMe != 1 return endif if Wearer.GetHealthPercentage < 0.7 DropMe endif End Edited September 10, 2014 by bioshards Link to comment Share on other sites More sharing options...
Ladez Posted September 10, 2014 Share Posted September 10, 2014 It saves for me, so there's nothing wrong with it. Did you use the NVSE launcher to open the GECK? Link to comment Share on other sites More sharing options...
Recommended Posts