Entity.TakeDamage

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:TakeDamage( Number amount, Entity attacker, Entity inflictor )
Description:
Apply damage to the specified entity.
Returns: nil
In Object: Entity
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.TakeDamage]Entity.TakeDamage [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionThis example function makes an entity take 15 damage from a specified attacker.
Used onNewerServer.png
Code
 
someEntity:TakeDamage( 15, someAttacker, someAttacker:GetActiveWeapon() )
 
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox