Entity.Health
From GMod Wiki
Function | |
Syntax | Entity:Health( ) |
Description: | |
Gets the current health of an entity. | |
Returns: | Integer health |
In Object: | Entity |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Entity.Health]Entity.Health [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Example
Description | Gets the health of the entity. |
---|---|
Used on | |
Code | // iEnt is an entity object local iHealth = iEnt:Health( ) |
Output | The health of the entity |
Notes
- This does not appear to do anything in Clientside scripts when used on anything but a player, returning 0.
- Seems to return a zero or a negative value if the entity is dead (not alive).