DarkRP.Entity.KeysUnLock

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:KeysUnLock()
Description:
Unlocks 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.KeysUnLock]Entity:KeysUnLock[/url][/b]

Examples

DescriptionUnlocks all doors.
Used onNewerServer.png
Code
function UnlockEverything()
 	for _, ent in ipairs(ents.GetAll()) do
		if ent:IsDoor() then
			ent:KeysUnLock()
		end
	end
end
OutputAll doors are unlocked.


Additional Notes

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