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

Seems that the issue is likely around this line.
When you convert it to use your version of qb-menu or whatever, are you passing a table or a string?
Make sure it’s a table. If the issue persists, try this and let me know;

local hasJob = (floor.jobs == nil or floor.jobs[1] == nil)

Im using qtarget and getting that problem

Yes, the targeting system shouldn’t matter. It’s the menu system.
Are you using the most update nh-context, or are you using qb-menu?

Most updated nh

Cool Release :heart:

1 Like

could you help me with that version? I have been trying to get this working but as I use an older version of nh-context for a bunch of other scripts its conflicting

IIRC the largest change is how nh handles tables. As such, look for the client portion of the script regarding the elevators and switch args to arg1. The section before changing should look like below:

table.insert(elevator, {
		id = index,
		header = floor.level,
		txt = floor.label,
		disabled = index == data.level,
		params = {
			event = "angelicxs_elevator:movement",
			args = {
				floor = floor
			}
1 Like

Thanks for your response!

No luck when I try that unfortunely :frowning:

Ive managed to get it to show the options by changing the names of the events but they just come up greyed out and i get locked in the menu until i restart nh-context, options are greyed out even with no job or item requirements

seems like the problem was mainly related to qs inventory not being able to find the item, have hit up quasar so will see if i can get a solution from him :slight_smile:

1 Like

For some reason I cannot get this script to work. I can target on the elevator and click the option but when i do do lick an option, nothing is happening, it doesn’t teleport me or anything

Are you receiving any errors that you can share?

no thats the strange part there is no client or server errors.

Are you using the correct dependencies (qtarget and the newest nh-context)? What framework are you using?

yes and yes, all my other target resources don’t seem to have any issues like this, just this one. I am using esx legacy

I actually got the floors menu to finally pop up but now i am experiencing the same issue as others where I can’t select any floors because everything is greyed out regardless of the config set up. SO even if i have the required job it still doesn’t make the options available

Sorry guys, I completely forgot about this thread…
So people are having issues with this script since I added the item functionality?
I had a quick look and pretty sure I found the problem in about 5 seconds.
I had v.count on line 128, when it should have been v.amount
I am amazed that nobody else spotted this :stuck_out_tongue:
I have made this change in the repo → GitHub - GouveiaXS/elevators: elevator script for fivem
Give that a crack and get back to me!
@TheFlyBandit @Midnight_Vybe @OttoActual

still having the same issue unfortunately :confused:

Ok, I am an idiot…
I changed it from count to amount, thinking it was for QBCore which uses amount, not count.
But it was in the ESX section, so it needs to be count.
So yes, it wasn’t that and I have undone the change on GitHub.
Let me think on it for a bit and see what I can do.
It’s hard when I don’t use qtarget, nh-context or anything to do with this resource xD
So I can’t do any testing. I just helped someone rewrite it haha
Leave it with me…

1 Like

I’m not available to edit and fix the code at the moment but I believe I found one of the issues.

Line 82 still has the Job check function which was replaced when the item support was added.

1 Like