# es\_extended

Hello! SharedEvents has been in ESX for around 5 years and should no longer be used since we now have way better ways to import the ESX object into your script!

### Import[​](broken://pages/ah6MEEHHhermKGzUPIup) <a href="#import" id="import"></a>

The import can be used by simply adding this into the `fxmanifest.lua`:

```
shared_script '@es_extended/imports.lua'
```

The import is the **best** and recommended way to use ESX within a script, this is because it will automatically sync data between ESX and the script, meaing the script will have automatic knowlege of ESX.PlayerData aswell as if you are loaded in aswell as the ability to detect when you are Relogging and/or switching characters, meaning no vulnerable events needed, to having to grab the entire playerdata table every time you want to use it, its just there, and working and amazing.

### Export[​](broken://pages/ah6MEEHHhermKGzUPIup) <a href="#export" id="export"></a>

The Export can be simply used by doing:

```
ESX = exports["es_extended"]:getSharedObject()
```

This Is great if your working on a multi-framework script so that the user does not have to change anything to switch between the frameworks. It Also has the benifit of not requiring you to wait into it has recived the object and prevents Race conditions.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://maxifaxipaxi-1.gitbook.io/mfpscripts-fivem-discontinued/error/es_extended.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
