ESX: how the framework works
ESX (the resource is named es_extended, the modern build is called ESX Legacy) is the framework that sits under a roleplay server. A framework is the shared engine your other scripts build on. ESX handles who is logged in, their money, their job, and their items. Other scripts ask ESX for that data instead of inventing their own. This lesson explains how ESX itself works, one piece at a time.
What is ESX
ESX is a framework for FiveM roleplay servers. Think of it as the foundation underneath all of your roleplay scripts.
ESX itself handles:
- Players who is logged in, their character, money, job, and more.
- Jobs police, mechanic, ambulance, and so on. Jobs live in the database, not in a file.
- Money cash, plus accounts like
bankandblack_money(dirty money). - Items the things a player carries in their inventory.
- Commands the things you type in chat with a slash, like
/car.
Other scripts (an inventory, a gas station, a car dealership) build on top of ESX and ask it for help: who is this player, how much money do they have, take 500 from their bank.
The one thing to remember: the framework resource is es_extended. Everything else is a separate script that depends on it.
Keep reading the full lesson
Sign in to start, then unlock every step of this lesson and the full FiveM School with a membership.
- Client and server: the two sides
- Getting the shared object
- xPlayer: everything about a player
- Server functions: money, jobs, items
- Client functions: notify and player data
- Commands: built-in and your own
- Callbacks: ask the server a question
- Jobs live in the database, not a file
- A complete mini example
- Common mistakes
The remainder of ESX: how the framework works is available to FiveM School members.