Jump to content

Script Problem


lilleku

Recommended Posts

Hi i am really stuck with my mod lillekus Adrenaline Mod

what 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

Hi i am really stuck with my mod lillekus Adrenaline Mod

what 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

As 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

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

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...