[Release] [Free] Elevator Script for ESX & QBCore

V3.0 is released.
Natively supports ox_lib, qb-menu and nh-menu.
Easily swap between third eye applications
Change how long players wait between floors in config.

Hey I got it to work but when I teleport it sends me to the same place everytime. a spot under the map

Is your config set up correctly?

I had it the other way with the vector3 and the heading separate and changed it to that to see if it would work and it did the samething

Config = {}

Config.UseESX = true – Use ESX Framework
Config.UseQBCore = false – Use QBCore Framework (Ignored if Config.UseESX = true)

Config.ThirdEyeName = ‘qtarget’ – Name of third eye aplication
Config.NHMenu = true – Use NH-Menu [GitHub - nerohiro/nh-keyboard: Dynamic Keyboard Input NUI for FiveM]
Config.QBMenu = false – Use QB-Menu (Ignored if Config.NHInput = true) [GitHub - qbcore-framework/qb-input]
Config.OXLib = true – Use the OX_lib (Ignored if Config.NHInput or Config.QBInput = true) [GitHub - overextended/ox_lib: A collection of Lua functions to utilise in other resources.] !! must add shared_script ‘@ox_lib/init.lua’ and lua54 ‘yes’ to fxmanifest!!
Config.ElevatorWaitTime = 3 – How many seconds until the player arrives at their floor

Config.Notify = {
enabled = true, – Display hint notification?
distance = 3.0, – Distance from elevator that the hint will show
message = “Target the elevator to use” – Text of the hint notification
}

–[[
USAGE
To add an elevator, copy the table below and configure as needed:
coords = vector3 coords of center of elevator
heading = Direction facing out of the elevator
level = What floor are they going to
label = What is on that floor
jobs = OPTIONAL: Table of job keys that are allowed to access that floor and value of minimum grade of each job
items = OPTIONAL: Any items that are required to access that floor (only requires one of the items listed)
jobAndItem = OPTIONAL: If true, you must you have a required job AND a required items. If false or nil no items are needed

]]

–[[
ExampleElevator = {
{
coords = vector3(xxx, yyy, zzz), heading = 0.0, level = “Floor 2”, label = “Roof”,
jobs = {
[“police”] = 0,
[“ambulance”] = 0,
[“casino”] = 0,
},
items = {
“casino_pass_bronze”,
“casino_pass_silver”,
“casino_pass_gold”,
}
},
{
coords = vector3(xxx, yyy, zzz), heading = 0.0, level = “Floor 1”, label = “Penthouse”,
jobs = {
[“police”] = 0,
[“ambulance”] = 0,
[“casino”] = 0,
},
items = {
“casino_pass_gold”,
},
jobAndItem = true
},
{
coords = vector3(xxx, yyy, zzz), heading = 0.0, level = “Floor 0”, label = “Ground”
},
},
]]

Config.Elevators = {

AtmosphereMHCLobby = {
	{
		coords = vector4(-151.52, -987.7, 29.37, 331.48), level = "Floor Top", label = "Atmosphere Restaurant",
		jobs = {}
	},
	{
		coords = vector4(-156.23, -985.99, 254.45, 0.0), level = "Floor 1", label = "Main Lobby",
		jobs = {}
	},
},

}

You have a jobs table with no jobs inside of it; that means no one will be able to use the elevator. If you want it accessible by everyone all you need is coords, heading, level, and label.

I used the coordinates you provided and had no issue going between the different levels of the construction site. If you are using a MLO it may be a case of people falling through it. Try to increase the Z coordinate by 0.5 to see if that helps.

As the elevator function is working as intended this is a map related issue.

qb-target/client.lua:397: attempt to index a nil value (field ‘?’)

getting that error when using qb-target.
im using QBCORE
all config sett to qbcore, qbmenu and qb-target

Can you provide any further details. A fresh install of qbcore using the QB settings showed no issues.

Hello,
I put your coordinates in a fresh server with no other influences and went to your designated coordinates with no issues. I recommend reviewing the resources you have in your server to see if you have any scripts that may conflict with the SetEntityCoords native.

Are you able to test a fake elevator? Basically pick two telephone poles to set up as your elevator spots and see if it will at least work teleporting you between the two telephone poles.

So even the telephone post test did not succeed?

Do you have a /tp function in your server? Does that work as intended?

If I’m Escorting Another Player Will The Come With Me In The Elevator Or Do They Have To Do So Manually?

Most escorts use AttachToEntity so they should come when used.

So im so happy i found your elevator script but im having some issues, i tried adding my own elevators to some apartments but whenever i approach it and press E nothing happens. I get no error in console, i also tried with qtarget to try use it but nothing happens

Is your config set up properly?
What version of the script are you using (found in fxmanifest)?

Config = {}

Config.UseESX = true – Use ESX Framework
Config.UseQBCore = false – Use QBCore Framework (Ignored if Config.UseESX = true)

Config.ThirdEyeName = ‘qb-target’ – Name of third eye aplication
Config.Use3DText = true – Use 3D text to interact
Config.NHMenu = true – Use NH-Menu [GitHub - whooith/nh-keyboard: Dynamic Keyboard Input NUI for FiveM]
Config.QBMenu = false – Use QB-Menu (Ignored if Config.NHInput = true) [GitHub - qbcore-framework/qb-input]
Config.OXLib = false – Use the OX_lib (Ignored if Config.NHInput or Config.QBInput = true) [GitHub - overextended/ox_lib: Modules to utilise in other resources via imports and exports.] !! must add shared_script ‘@ox_lib/init.lua’ and lua54 ‘yes’ to fxmanifest!!
Config.ElevatorWaitTime = 3 – How many seconds until the player arrives at their floor

Config.Notify = {
enabled = false, – Display hint notification?
distance = 3.0, – Distance from elevator that the hint will show
message = “Target the elevator to use” – Text of the hint notification
}

when i press e on elevator nothing happens and no error in console

As per the previous question, what version are you using? The most recent update is V3.2.0.

as i said i was using the latest update so to clearify yes im using version 3.2.0

Do you have the v2 of nh-context?
If you restart the script while you are in the server do you see any client or server sided errors?

Hiya! Just downloaded this, and I’ve been getting this error on every launch. Can post my Config if needed, but this is the error

Edit: Nvm! Config was wrong!