Zerio Proximity Prompts

Hello guys, this is a simple to use “proximity prompt” / “helptext” script. I hope you guys will like it, it’s fully open sourced and can easily be added for basically any script!

This script is “standalone” but requires ESX / QB-Core for job authorization!

Example Usage:
(This includes all parameters, you can skip the ones you dont care about and it will just use the default value)

exports["zerio-proximityprompt"]:AddNewPrompt({
    name = "testprompt", -- unique name, kinda like an "id"
    job = "police", -- job required to use it, remove if you want everyone to see it
    objecttext = "World", -- upper texqt / "object text"
    actiontext = "Interact with something", -- lower text / "action text"
    holdtime = 5000, -- amount of time you have to hold in milliseconds for it to execute the action
    key = "E", -- key to press
    position = vector3(0.0, 0.0, 0.0), -- position of the proximity prompt
    params = {"test", "data"}, -- this gets passed through into the usage callback as shown below
    usage = function(data) -- function which gets executed when you use the proximity prompt
        print("Proximity prompt got used, the following params got passed: " .. json.encode(data))
    end,
    drawdist = 3, -- max distance to see the prompt
    usagedist = 1.5 -- max distance to use the prompt
})

Preview (If video doesnt load)
Download Now

Alternative download | Github Link

Code is accessible Yes
Subscription-based No
Lines (approximately) ~500
Requirements None
Support No

Previous Scripts:
Zerio Progress Bars
Zerio Crafting
Zerio Bossmenu
Zerio Radio
Zerio Cardealer
Zerio Jobcenter
Zerio Garage
Zerio Characters

12 Likes

You should upload it directly to the forums or GitHub since it’s free.

1 Like

This is really cool, good job!

2 Likes

Thank you!

1 Like

Yeah I added a GitHub link although I don’t think it’s needed.

thank you

2 Likes

Great idea! Whats the resmon on this? with 1 or maybe 5 in close range?

1 Like

When not being close or looking away from it its always 0.00 (maybe 0.01 if you have alot of them),
When testing 1 visible at the same time it was 0.03/0.04, with 2 visible on the screen at the same time it was 0.05, I have never tested 5 visible at the same time and I dont think anyone will need it.

EDIT I now tested it with 5 of them at the same time (I dont think anyone will ever need so many though) But I got 0.07 whilst drawing all of them:


0.00 when far away, will be trying to optimize the resmon when far away though since it seems to jump up to 0.01 sometimes.

I have now also tested the resmon with having 100 of them running in the background, which also sits at a steady 0.01 / 0.00 :+1:
0.10 whilst running 1000 individual prompts in the background

3 Likes

The script runs and when I call the add prompt function nothing appears. If I try to add it again, the console shows that the prompt already exists.

1 Like

Amazing looking free resource, looks neat.
Thank you for sharing it for free!

2 Likes

Could you show the parameters you are passing into the export?
// The code you are using to add it.

1 Like

Try to create a command within client.lua itself, which calls the add or prompt function, but it still didn’t work. I’m using linux, do you have any limitations regarding the OS?

1 Like

Are you sure that you are at the right “position” in the world?
And make sure you havent renamed it since that might cause some issues with the javascript side of it.

1 Like

In position I add my cds coordinates, am I sure about that?

1 Like

Are you getting any errors then?
And you still didnt really answer. The coordinates which you have added in your code, are you at those coordinates in the game? And have you renamed the script? By default it has to be named exactly “zerio-proximityprompt”

1 Like

Yes, I’m at the script coordinates and I haven’t renamed the file. I don’t get any compilation errors in the console, only the warning that I already created the prompt when I give the command to run again

2 Likes

No idea, works fine for me.
If you really want help with it then join our support server.
Since it is quite hard to give out support through the forum.

1 Like

Help error : “there is already a proximity prompt with the id”

1 Like

Show the code you are using to create the prompt please.

just wondering is there a way to attach this to props? I have tried to set the cords for the props and it just returns with the id is already being used. For example I took the “HideInTrash” script and tried to change the DrawText to the export for the script. Thanks in advance!