DarkRP.Entity.Own

From Official DarkRP Wiki
Jump to navigation Jump to search
This page refers to DarkRP 2.4.3. This information may be incorrect as of later versions.
Check here for a up-to-date list of functions.
Function
Function name Entity:Own(Player player)
Description:
Makes the player own the entity (mainly used if it's a door).
Returns: nil
Part of Library: Entity
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.darkrp.com/index.php?title=DarkRP.Entity.Own]Entity:Own[/url][/b]

Examples

DescriptionMakes the player own the door upon touch.
Used onNewerServer.png
Code
function ENT:Touch( hitEt )
 	if ( hitEnt:IsValid() and hitEnt:IsPlayer() ) then
		if (self:IsOwnable() == true) then
 			self:Own( hitEt )
		else
			self:Kill() --You should of put this in a doors code lol!
		end
	end
 end
OutputN/A