Entity.GetOwner

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:GetOwner( )
Description:
Returns the owner of the entity, set with Entity:SetOwner. Make sure to do Entity:IsValid() on the returned entity to determine if the prop has an owner.
Returns: Entity or Player
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.GetOwner]Entity.GetOwner [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Notepad-48.png Entity:GetOwner() does NOT return the player who spawned the entity! It only returns what's set by Entity:SetOwner


Examples

DescriptionReturns true if an entity has an owner, false otherwise.
Used onNewerShared.png
Code
function HasOwner( ent )
    return ValidEntity( ent:GetOwner() )
end
OutputN/A


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox