lilleku Posted April 18, 2007 Share Posted April 18, 2007 Hi i am really stuck with my mod lillekus Adrenaline Modwhat i am stuck with is a trigger or function, it is supposed to trigger when hit by anything(including falling down a hill and so on) that causes 20% loss of health.my code this far looks like this: set BaseHitPoints to player.getbaseav health set OneThirdHealth to BaseHitPoints * 0.3333 set TwentyPercentHealth to BaseHitPoints * 0.20 if (player.getav health >= -TwentyPercentHealth) endif did that make any sense? XD i have looked around, but with my limited scripting skill i cant seem to find a solution thanks in advance Link to comment Share on other sites More sharing options...
Abramul Posted April 18, 2007 Share Posted April 18, 2007 Hi i am really stuck with my mod lillekus Adrenaline Modwhat i am stuck with is a trigger or function, it is supposed to trigger when hit by anything(including falling down a hill and so on) that causes 20% loss of health.my code this far looks like this: set BaseHitPoints to player.getbaseav health set OneThirdHealth to BaseHitPoints * 0.3333 set TwentyPercentHealth to BaseHitPoints * 0.20 if (player.getav health >= -TwentyPercentHealth) endif did that make any sense? XD i have looked around, but with my limited scripting skill i cant seem to find a solution thanks in advanceAs is, it's either invalid (-Variable may not be acceptable syntax), or will trigger EVERY frame (x >= -.2 * x is true for any positive value of x). I'm assuming this is a code fragment, and you've properly declared variables elsewhere and are using a GameMode block. short HealthFrameBefore set BaseHitPoints to player.getbaseav health set OneThirdHealth to BaseHitPoints * 0.3333 set TwentyPercentHealth to BaseHitPoints * 0.20 if (HealthFrameBefore - player.getav health >= TwentyPercentHealth) ;Do stuff endif set HealthFrameBefore to player.GetAV health You may want to set it up to check every second instead of every frame, as some things (for instance, spells) may not cause instantaneous damage. Link to comment Share on other sites More sharing options...
lilleku Posted April 18, 2007 Author Share Posted April 18, 2007 Thanks Abramul, that was just what i neede in my moment of paralysis :D i am back in business(i think, i have left to test it), and yes that wasnt my whole script... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.