TheSkoomaKing Posted September 17, 2012 Share Posted September 17, 2012 Hello, i am tryin to make a script on an NPC that is in combat with the player. when that NPC reaches 20% of his help i want him to stop attacking. I think i need to use the " SetAVHealth". But i just dont know how. any help? Link to comment Share on other sites More sharing options...
Sjogga Posted September 17, 2012 Share Posted September 17, 2012 Is it on a specific npc or just anyone? Link to comment Share on other sites More sharing options...
TheSkoomaKing Posted September 17, 2012 Author Share Posted September 17, 2012 Is it on a specific npc or just anyone? it is a specific NPC. I am trying to make a "Unique fight" were you are fighting "this guy" and when he is at 20% health he realises that he is beaten. just do not know the script for it. Any ideas? Link to comment Share on other sites More sharing options...
Sjogga Posted September 17, 2012 Share Posted September 17, 2012 (edited) scriptname UniqueFightScript extends Actor event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \ bool abBashAttack, bool abHitBlocked) int currentHealth = self.getav("health") if( currentHealth <= self.getbaseav("health") * 0.2) self.stopcombat() endif endEvent Try this. Edited September 17, 2012 by Sjogga Link to comment Share on other sites More sharing options...
TheSkoomaKing Posted September 17, 2012 Author Share Posted September 17, 2012 scriptname UniqueFightScript extends Actor event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \ bool abBashAttack, bool abHitBlocked) int currentHealth = self.getav("health") if( currentHealth <= self.getbaseav("health") * 0.2) self.stopcombat() endif endEvent Try this. Thank you so much for taking your time. i will test it right when i get home. I will contact you later about the result :) Link to comment Share on other sites More sharing options...
steve40 Posted September 28, 2012 Share Posted September 28, 2012 scriptname UniqueFightScript extends Actor event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) if getAVPercentage("health") <= 0.2 stopcombat() endif endEvent Link to comment Share on other sites More sharing options...
Recommended Posts