DarkRP.Entity.addDoorOwner

From Official DarkRP Wiki
Jump to: navigation, 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:addDoorOwner(Player ply)
Description:
Makes another player own the door.
Returns: nil
Part of Library: Entity
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.darkrp.com/index.php?title=DarkRP.Entity.addDoorOwner]Entity:addDoorOwner[/url][/b]

Examples

DescriptionMakes a player own every door.
Used onNewerServer.png
Code
--ply = player that's gonna own all these doors
for _, ent in ipairs(ents.GetAll()) do
	if ent:IsDoor() == true then
		ent:addDoorOwner(ply)
	end
end
OutputN/A


Important things to know

  • AddAllowed makes the player allowed to own the door, this makes the player own it too.