DarkRP.Entity.KeysLock

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:KeysLock()
Description:
Locks the entity, if possible.
Returns: nil
Part of Library: Entity
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.darkrp.com/index.php?title=DarkRP.Entity.KeysLock]Entity:KeysLock[/url][/b]

Examples

DescriptionLocks all doors.
Used onNewerServer.png
Code
function LockEverything()
 	for _, ent in ipairs(ents.GetAll()) do
		if ent:IsDoor() then
			ent:KeysLock()
		end
	end
end
OutputAll doors are locked.


Additional Notes

  • Examples of entities which can be locked/unlocked include doors and vehicles.