IfHealth

From ZDoom Wiki
Jump to navigation Jump to search

IfHealth [not] <value> [%]

Executes the following sub block if the player's health is greater than or equal to value. If not is provided, the check is inverted, and the sub block is executed if the player's health is less than value. Passing %, makes the check percentage-based instead of being hit points-based.

Examples

This block of code is executed if the player's health is greater than or equal to 100 points.

IfHealth 100
{
  // commands...
}


This one, however, is executed if the player's health is less than 75%.

IfHealth not 75 %
{
  // commands...
}