Garry's Mod Wiki


  Entity:SetHealth( number newHealth )


Sets the health of the entity.

You may want to take Entity:GetMaxHealth into account when calculating what to set health to, in case a gamemode has a different max health than 100.
In some cases, setting health only serverside can cause hitches in movement, for example if something is modifying the player speed based on health.
To solve this issue, it is better to set it shared in a predicted hook.


1 number newHealth
New health value.


Sets the entity's health to their maximum health.

Output: The entity's health is now full.


Deducts 50 points of health from the entity.

Entity( 1 ):SetHealth( Entity( 1 ):Health() - 50 )
Output: The entity now has 50 less health.