Crimsonfoxy Posted November 22, 2011 Share Posted November 22, 2011 This code doesn't seem to be working. I've got the script attached to a new type of Bighorner. Pretty much a duplicate of the standard Bighorner, nothing special, just needed something to test it on. I presume I'm using the correct functions, I can't seem to find any others that would apply to this situation. Any help guys? scn HealthDetectBighorner ref BighornerREF short doOnce begin onHit set BighornerREF to GetOwnerLastTarget if ( doOnce == 0 ) if ( BighornerREF.GetHealthPercentage < 0.80 ) showmessage HealthLow set doOnce to 1 endif endif end Link to comment Share on other sites More sharing options...
rickerhk Posted November 22, 2011 Share Posted November 22, 2011 GetOwnerLastTarget runs on a weapon script to get the ref of it's last target that was hit. http://geck.bethsoft.com/index.php/OnHit If this script is running on your Bighorner, all you should need it this: scn HealthDetectBighorner short doOnce begin onHit if ( doOnce == 0 ) if (GetHealthPercentage < 0.80 ) showmessage HealthLow set doOnce to 1 endif endif end The GetHealthPercentage function in this case is performed on the actor that the script is running on, so you don't need the actor's reference. Link to comment Share on other sites More sharing options...
Crimsonfoxy Posted November 22, 2011 Author Share Posted November 22, 2011 Ah, so close. Thanks for the perfect answer! Link to comment Share on other sites More sharing options...
Recommended Posts