Entity.GetPhysicsAttacker

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:GetPhysicsAttacker( )
Description:
Returns the player object who is claiming kills on any physics damage the entity deals.
Returns: Player
In Object: Entity
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.GetPhysicsAttacker]Entity.GetPhysicsAttacker [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionFinds if a prop has a physics attacker.
Used onNewerShared.png
Code
--assuming ent is any entity object, although Ithink only prop_physics can have and use a physicsattacker
if ent:GetPhysicsAttacker():IsPlayer() then
Msg ("ent physics attacker: "..ent:GetPhysicsAttacker():Nick().."\n")
end
OutputMessages back the player responsible for the rampage of ent.


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox