You are currently viewing FiveM Esx Door Key as Item

FiveM Esx Door Key as Item

Hello everyone,
I hope you’re doing well. Today we will check usefull script which adds door key as usable item. You can open particular door only if you have a required key. You can also add condition as combination of key and
required job as well. Key can be given to someone or sold.But most realistic feature! now you can lost your key or leave it somewhere so you will start
scratching you head in front of the door and try to figure out where you have left your key 😉

At first you need to add keys to the items table (to be able to have those in the inventory). Script don’t have sql for that, but we can just add items by ourselves. Per default you need 2 keys for the script: magickey and
green-keycard. You can use this sql to add a keys to your items table (for the esx version 1.0 for other versions you can adjust colums like weight instead of limit)

INSERT INTO items (name, label, limit, rare, can_remove) VALUES
(‘green-keycard’, ‘Green Keycard’, 1, 0, 1),
(‘magickey’, ‘Magic Key’, 1, 0, 1);

config.lua
Here you can:
Set language (config.Locale) or add language file (locales folder).
Add/Adjust/Remove new doors, if you want to add new one just
copy paste the parameters set and adjust it.
objName = Door object name
objYaw = angle/direction of the door when closed
objCoords/textCoords = Position of the door/text
needJob = enable job condition
authorisedJobs = array of jobs which are allowed to open a door
keyNeeded = name of the key from the items table
removeKey = if key should be romoved after usage
locked = default state of the door (i.g. on server start) locked or open

You can create a kind of scenario as combination between key door, starlite motel mlo and advanced shops which you can use as reception. Just put keys for each room in the stock and players can (buy it) rent a room.

Here is a tutorial and review for this resource so stay healthy and have a good year ahead.

[RELEASE] esx_keydoor – Open door with needed key
https://forum.cfx.re/t/release-esx-keydoor-open-door-with-needed-key/1359641

If you need FiveM Gameserver with one click installation check this:
https://zap-hosting.com/rpscripts
20% discount if you want: denmak-a-6883

If you need some general Fivem help, you can take a look at this Discord server:
https://discord.gg/Bdk3QHX