bioshards Posted September 9, 2014 Share Posted September 9, 2014 i need a script for apearal that checks if the actor wearing it has taken a specific amount of damage Link to comment Share on other sites More sharing options...
Ladez Posted September 9, 2014 Share Posted September 9, 2014 You need to be more specific. Is this just a check for how much HP the actor currently has left, or do you want to consider how much damage the actor has lost over time? Link to comment Share on other sites More sharing options...
bioshards Posted September 9, 2014 Author Share Posted September 9, 2014 I need a script that i can put on a hat that once the actor wearing it has lost 40% of their health, the hat would be dropped on the on the ground Link to comment Share on other sites More sharing options...
Hemingway308 Posted September 9, 2014 Share Posted September 9, 2014 (edited) ref Wearerref rMefloat fHealthPercentfloat 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 let fHealthPercent := (Wearer.GetAV "Health") / Wearer.GetBaseHealth if fHealthPercent < 0.4 Wearer.Drop rMe endif End Edited September 9, 2014 by Hemingway308 Link to comment Share on other sites More sharing options...
bioshards Posted September 9, 2014 Author Share Posted September 9, 2014 Is it possible to have a script thats not on a timer? I have alot of bad expiences with timers Link to comment Share on other sites More sharing options...
Ladez Posted September 9, 2014 Share Posted September 9, 2014 It's really harmless, but just remove the timer part if you don't want it. Link to comment Share on other sites More sharing options...
Hemingway308 Posted September 9, 2014 Share Posted September 9, 2014 Haha, yeah thats justified, I actually had a mistake in the that code (forgot the 'let fTimer := 0'). If you do the timer that way it will work though, the mistake is not incrementing a float- either they use an int or just check GetSecondsPassed (which returns something like 0.05). Use that (edited) code and it will work though. ;) If you skip the timer then a game mode block (except quests) will run every frame, so 30-120 times per second. So, a waste of resources. Also, that script will run when the hat is not equipped, if you want to stop that, use IsEquipped (new nvse), or Wearer.GetEquipped MyHat. Link to comment Share on other sites More sharing options...
Ladez Posted September 9, 2014 Share Posted September 9, 2014 ... use IsEquipped (new nvse) ...What function is that? Doesn't compile when I try it. Link to comment Share on other sites More sharing options...
Hemingway308 Posted September 9, 2014 Share Posted September 9, 2014 You'll have to wait for the new NVSE ;). Link to comment Share on other sites More sharing options...
bioshards Posted September 9, 2014 Author Share Posted September 9, 2014 Is there a way i can check if its equiped? My character keeps dropping the hats even when the hat isnt equiped, its also very strange seeing my character dropping 20 hats for no reason like sonic dropping rings Link to comment Share on other sites More sharing options...
Recommended Posts