Entity class
Part of Prop Protection
Summary
Methods
Methods
Checks whether a player may drive the entity, as the CPPI asks for it.
Parameters
- actor Player
Returns
- Boolean
Checks whether a player may pick the entity up with the physics gun, as the CPPI asks for it.
Parameters
- actor Player
Returns
- Boolean
Entity:CPPICanProperty(actor, property)
shared plugins/propprotection/plugin/lib/meta/sh_entity.lua:69Checks whether a player may use a property of the context menu on the entity, as the CPPI asks for it.
Parameters
- actor Player
- property String property name
Returns
- Boolean
Checks whether a player may use a tool on the entity, as the CPPI asks for it.
Parameters
- actor Player
- tool String tool ID
Returns
- Boolean
Returns the owner of the entity, as the CPPI asks for it.
Returns
- Player the owner, or nil if the entity belongs to nobody or its owner is not connected on the character that owns it; String the ownership key as the unique ID of the owner, nil if the entity belongs to nobody
Gives the entity to the active character of a player, as the CPPI asks for it. Server only.
Parameters
- owner Player optional, defaults to
nilthe new owner; the entity is released when nil
Returns
- Boolean true if the entity now belongs to the player or, when it was released, if it had an owner
See also
Returns the player the entity belongs to.
Returns
- Player the owner, or nil if the entity belongs to nobody or its owner is not connected on the character that owns it
Returns the key of the character the entity belongs to.
Returns
- String ownership key, see PropProtection:get_key; nil if the entity belongs to nobody
Checks whether the entity belongs to the active character of a player.
if entity:is_prop_owner(actor) then
entity:Remove()
end
Parameters
- target Player
Returns
- Boolean
Entity:set_prop_owner(target, permanent)
server plugins/propprotection/plugin/lib/meta/sh_entity.lua:123Gives the entity to the active character of a player, or to nobody. Server only.
Parameters
- target Player optional, defaults to
nilthe new owner; the entity is released when nil - permanent Boolean optional, defaults to
niltrue to keep the entity when its owner leaves
Returns
- Boolean true if the entity now belongs to the player or, when it was released, if it had an owner