Entity.GetMaxHealth

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:GetMaxHealth( )
Description:
Returns the maximum amount of health the entity can have.
Returns: Integer
In Object: Entity
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.GetMaxHealth]Entity.GetMaxHealth [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionSet the health of the player with the index 1 to it's maximum (200).
Used onNewerServer.png
Code
local ply = player.GetByID( 1 )
 
ply:SetMaxHealth(200)
 
ply:SetHealth( ply:GetMaxHealth( ) )
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox