Jump to content

Health Percent of NPCS


Pygan

Recommended Posts

Is there any kind of function to modify the health percentage of a person/creature? I want to be able to drop someones health by 50% if i wanted to. As far as i can tell i can only modify the value by a given amount not a percentage.

It would also be nice if there was a function that could return the health as a percentage. I feel like this has to be possible and i'm just missing something.

Link to comment
Share on other sites

This is totally untested, and is not a final script, but comes to mind (need to find your ActorREF, obviously):

 

Short Percentage

Short HealthAmount

Float ReduceHealthAmount

 

Begin GameMode

 

set Percentage to 50

set HealthAmount to <ActorREF>.GetActorValue Health

set ReduceHealthAmount to HealthAmount * ( Percentage / 100 )

<ActorREF>.ModActorValue Health ReduceHealthAmount

set HealthAmount to 0

set ReduceHealthAmount to 0

 

End

Link to comment
Share on other sites

  • Recently Browsing   0 members

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