Entity.SetHealth

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:SetHealth( Integer Health )
Description:
Set's an entity or player's health.
Returns: nil
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.SetHealth]Entity.SetHealth [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Example

DescriptionSet's an entity's health.
Used onNewerShared.png
Code
-- Use SetHealth to change an entity's (or player's) health.
MyEntity:SetHealth(1) -- Set's "MyEntity"'s health to 1.
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox