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
})
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
0.10 whilst running 1000 individual prompts in the background
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?
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.
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”
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
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.
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!