[Release] esx_teleports, easy configurable teleport script, you can specify jobs

This script was just made because i had nothing to do, if you want teleporters to interiors etc. You could use this script and specify a job if you would like only an certain job to access it, easy configurable in config.lua.

If you find any bug feel free to comment down below.

Download

esx_teleports Download

9 Likes

:thinking:


Previews? Screenshots? Gifs? Video? Would make it easier so people can see what they are downloading lol. Even if it is a basic script.

2 Likes

There is redundant code in this script.

In the first part you do the following

PlayerData = ESX.GetPlayerData()

But a bit further down with esx:playerLoaded

PlayerData = xPlayer

So that code is very very redundant to be honest, you do the same thing 2 times

What you could do insted is move LoadMarkers() down in to esx:playerLoaded, and clean up the first part.

It makes more sence to me using the build in function thats called when data is loaded esx:playerLoaded.

You avoid setting the same variable twice, and avoid the check to se if ESX.GetPlayerData() is not nil.

Citizen.CreateThread(function ()
    while ESX == nil do
        TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
        Citizen.Wait(1)
    end
end) 

RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(xPlayer)
    PlayerData = xPlayer
    LoadMarkers()
end)

Original code

Citizen.CreateThread(function ()
    while ESX == nil do
        TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
        Citizen.Wait(1)
    end

    while ESX.GetPlayerData() == nil do
        Citizen.Wait(10)
    end

    PlayerData = ESX.GetPlayerData()

    LoadMarkers()
end) 

RegisterNetEvent('esx:playerLoaded')
AddEventHandler('esx:playerLoaded', function(xPlayer)
    PlayerData = xPlayer
end)

It’s for restarting the script if you restart it it wont do esx:playerLoaded

True. but why keep esx:playerLoaded then ? if you load it the other way, there should be no need for playerLoaded

Thank you very much, @qalle ! Just in time of need! :slight_smile:

So the way you explain is the right way ?

Can i use more than 1 job? I need to make an entrance to a nightclub for everyone to use

Did any one have this working every time i go in to a map building whitch it base under the ground it TP’s me and car on top of ground and not in building under the ground please help here

i’m trying to dev so that the tp function works with esx_organization

anyone know how to add it so it allows you to teleport with a vehicle?

I’d also love being able to teleport with vehicle

This teleport can use with cars?

is it teleport vehicle too ?

Teleport with car.
main.lua (5.2 KB)

1 Like

did u find the solution?

@overloadfran
es, I use the ESX nightclub script also released in on this Forum, It was just alot easier :slight_smile:

Thank you for replying! :slight_smile:

Ty for the fast response!!
Have a good day! :grinning::grinning:

1 Like

Hey!! u know how can i chance the specify job for a servergroup