Entity.SetOwner
From GMod Wiki
Revision as of 15:35, 30 October 2009 by Crazy Quebecer (Talk | contribs)
Function | |
Syntax | Entity:SetOwner( Entity ) |
Description: | |
Sets the 'owner' of an entity. This disables collision between the entity and its owner. If the prop kills another entity, the owner of the prop will be the inflictor and will get credit for the kill. | |
Returns: | nil |
In Object: | Entity |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Entity.SetOwner]Entity.SetOwner [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Entity:SetOwner should not normally be used unless you want to disable collision between two entities. Sure, Entity:GetOwner gets what's set by Entity:SetOwner, but Entity:SetOwner also disables collisions and gives kill credit to the "owner". If you simply want to give kill credit, use Entity:SetPhysicsAttacker |
Examples
Additional Notes
- You can walk through an entity you own, and you can't physgun it.
- Bullets goes through entities you own.
- The owner does not have to be a player. It can be any type of entity.
- This function (Or the C++ equivalent) is used for weapons. Hence why collision is disabled and the owner takes kill points.