# ESX FiveM (esx-fivem.com) > Independent, source-verified documentation for the ESX Legacy framework for FiveM: installation, es_extended API, xPlayer, core resources, addons and step-by-step guides. Covers ESX Legacy 1.16.4. Independent community documentation, not affiliated with the ESX team. Every page is available as Markdown by appending `.md` to its URL (e.g. https://esx-fivem.com/docs/es_extended/server/xplayer.md). Full content in one file: https://esx-fivem.com/llms-full.txt Official sources: https://docs.esx-framework.org/en, https://github.com/esx-framework/esx_core, https://github.com/esx-framework/ESX-Legacy-Addons # ESX Docs - [Introduction to ESX Legacy](https://esx-fivem.com/docs): What ESX Legacy is, how the FiveM framework is built (es_extended, core resources, addons, oxmysql, OneSync) and how this independent documentation is organized. - Getting Started - [Install ESX Legacy with txAdmin](https://esx-fivem.com/docs/getting-started/installation): Step-by-step guide to install ESX Legacy on a FiveM server with the official txAdmin recipe, including MariaDB setup, license key and what the recipe installs. - [Manual Installation (without txAdmin)](https://esx-fivem.com/docs/getting-started/manual-installation): Install ESX Legacy by hand - download esx_core and the addons, import legacy.sql, add oxmysql and esx_lib, and set the correct ensure order in server.cfg. - [server.cfg for ESX Legacy](https://esx-fivem.com/docs/getting-started/server-cfg): Annotated server.cfg for ESX Legacy - ensure order, mysql_connection_string formats, OneSync, admin ACE permissions and every convar es_extended reads. - [Your First ESX Resource](https://esx-fivem.com/docs/getting-started/first-resource): Build your first ESX Legacy resource step by step - fxmanifest with imports.lua, a server command with xPlayer, client notifications and a server callback. - [Coding Practices for ESX](https://esx-fivem.com/docs/getting-started/coding-practices): Best practices for ESX Legacy scripts - naming, locals vs globals, efficient loops, event-driven code, caching, modern natives, Lua 5.4 features and server security. - [Lua Annotations for ESX](https://esx-fivem.com/docs/getting-started/annotations): Use LuaLS annotations in ESX scripts - document functions, classes and types, reuse the xPlayer and ESXJob types from es_extended, and set up VS Code for autocomplete. - [Updating ESX Legacy](https://esx-fivem.com/docs/getting-started/updating): How to update ESX Legacy safely - back up database and resources, replace the core, let migrations run, apply optional SQL hardening and test before going live. - [Troubleshooting ESX Legacy](https://esx-fivem.com/docs/getting-started/troubleshooting): Fix common ESX Legacy errors - ESX is nil, oxmysql connection failures, es_extended not starting, OneSync kicks, players stuck on loading and multicharacter problems. - [Tools for ESX Development](https://esx-fivem.com/docs/getting-started/tools): Useful tools for building and running an ESX Legacy server - VS Code extensions, database clients, txAdmin and community web tools for clothing, assets and merging. - es_extended - [es_extended](https://esx-fivem.com/docs/es_extended): es_extended is the core resource of ESX Legacy. Learn how to get the ESX object, how the resource is structured and how a player loads, with links to every API. - [PlayerData](https://esx-fivem.com/docs/es_extended/playerdata): What ESX Legacy stores about a character and where to read it. Every field of ESX.PlayerData on the client and the xPlayer object on the server, with types. - [Commands](https://esx-fivem.com/docs/es_extended/commands): All built-in ESX Legacy chat and console commands with arguments, aliases and default permissions, plus how to change who can use them and add your own. - Config - [Main Config](https://esx-fivem.com/docs/es_extended/config): Every key in es_extended shared/config/main.lua for ESX Legacy 1.16.4 with type, default value and effect. Accounts, spawns, paychecks, permissions and convars. - [Weapons Config](https://esx-fivem.com/docs/es_extended/config/weapons): How es_extended defines weapons, ammo types, components and tints in shared/config/weapons.lua, and how to add a custom or addon weapon to ESX Legacy. - [Adjustments Config](https://esx-fivem.com/docs/es_extended/config/adjustments): es_extended adjustments.lua explained. Toggle PvP, wanted level, dispatch, NPC density, HUD components, AI plates and Discord Rich Presence in ESX Legacy. - [Logs Config](https://esx-fivem.com/docs/es_extended/config/logs): Configure Discord webhook logging in ESX Legacy. Webhook names, embed colors, which ESX features log where, and how to log from your own resources. - Server - [Server Functions](https://esx-fivem.com/docs/es_extended/server/functions): Every ESX.* server function in ESX Legacy 1.16.4 with signatures, parameters, return values and examples. Players, callbacks, commands, jobs, items and vehicles. - [xPlayer](https://esx-fivem.com/docs/es_extended/server/xplayer): Complete ESX Legacy xPlayer reference. Every server-side player method for money, accounts, inventory, jobs, weapons, metadata and notifications, verified against 1.16.4. - [OneSync Functions](https://esx-fivem.com/docs/es_extended/server/onesync): ESX.OneSync server functions for ESX Legacy. Find nearby players, peds, objects and vehicles and spawn server-owned entities with SpawnVehicle and SpawnPed. - Client - [Client Functions](https://esx-fivem.com/docs/es_extended/client/functions): Reference for ESX Legacy client functions such as ESX.IsPlayerLoaded, ESX.GetPlayerData, ESX.SearchInventory and ESX.SecureNetEvent, with examples. - [Client UI](https://esx-fivem.com/docs/es_extended/client/ui): ESX Legacy client UI functions for notifications, help text, TextUI, progress bars, the context menu and ESX.UI.Menu, with parameters and examples. - Modules - [Callbacks](https://esx-fivem.com/docs/es_extended/client/modules/callback): How ESX Legacy callbacks work: TriggerServerCallback, AwaitServerCallback, RegisterServerCallback and client callbacks, with timeouts and limits. - [ESX.Game](https://esx-fivem.com/docs/es_extended/client/modules/game): ESX.Game client reference for ESX Legacy - spawn and delete vehicles and objects, find the closest player or vehicle, and get or set vehicle properties. - [Interactions](https://esx-fivem.com/docs/es_extended/client/modules/interactions): Use ESX.RegisterInteraction, ESX.RemoveInteraction and ESX.GetInteractKey to bind world actions to the shared ESX interact key (E by default). - [Scaleform](https://esx-fivem.com/docs/es_extended/client/modules/scaleform): ESX.Scaleform functions show GTA scaleforms like the wasted shard, breaking news and popup warnings, plus helpers to load movies and call scaleform methods. - [Streaming](https://esx-fivem.com/docs/es_extended/client/modules/streaming): ESX.Streaming loads models, animation dictionaries, anim sets, texture dictionaries, particle assets and weapon assets safely with a timeout in ESX Legacy. - Imports - [Points](https://esx-fivem.com/docs/es_extended/client/imports/point): ESX.Point creates proximity points with enter, leave and inside callbacks in ESX Legacy, replacing distance loops. Learn the options, methods and pitfalls. - [Require](https://esx-fivem.com/docs/es_extended/client/imports/require): Load Lua modules in ESX Legacy with require, ESX.require, ESX.load and ESX.loadJson from es_extended and esx_lib imports, including modules from other resources. - Shared - [Shared Functions](https://esx-fivem.com/docs/es_extended/shared): ESX Legacy functions available on both client and server - GetConfig, weapon lookups, ValidateType, IsValidLocaleString, GetRandomString and ESX.Await. - [Math](https://esx-fivem.com/docs/es_extended/shared/math): ESX.Math reference for ESX Legacy - Round, GroupDigits, Trim, Random and GetHeadingFromCoords, with exact behavior, examples and common pitfalls. - [Table](https://esx-fivem.com/docs/es_extended/shared/table): ESX.Table reference for ESX Legacy - SizeOf, Find, Filter, Map, Clone, Concat, Join, TableContains, Sort, ToArray and more, with return values and pitfalls. - [Timeout](https://esx-fivem.com/docs/es_extended/shared/timeout): ESX.SetTimeout and ESX.ClearTimeout run code after a delay in ESX Legacy and let you cancel it, on both client and server. Includes examples and pitfalls. - [Client PlayerData](https://esx-fivem.com/docs/es_extended/shared/playerdata): What ESX.PlayerData contains on the client in ESX Legacy, how it stays in sync with the server, and how to react to changes with OnPlayerData and esx:setPlayerData. - Events - [Server Events](https://esx-fivem.com/docs/es_extended/events/server): Every esx server event in ESX Legacy 1.16 with parameters, who triggers it and example handlers, plus which client-sent events are untrusted and must be validated. - [Client Events](https://esx-fivem.com/docs/es_extended/events/client): Every esx client event in ESX Legacy 1.16 - playerLoaded, setJob, vehicle and death events - with parameters, sender, handler examples and security notes. - Core Resources - [Core Resources](https://esx-fivem.com/docs/core): Overview of every ESX Legacy 1.16.4 core resource in [core], what each one does, which are required, and the recommended ensure order for server.cfg. - [esx_lib](https://esx-fivem.com/docs/core/esx_lib): esx_lib reference for ESX Legacy. Load xLib, use callbacks, cache, points, NUI, rate limiting, tokens, pub/sub and every module with signatures. - [esx_context](https://esx-fivem.com/docs/core/esx_context): esx_context reference for ESX Legacy. Open mouse-driven context menus and small forms with ESX.OpenContext, element fields, exports, keybind and pitfalls. - [esx_identity](https://esx-fivem.com/docs/core/esx_identity): esx_identity lets ESX Legacy players register first name, last name, date of birth, sex and height. Config, events, commands and validation rules. - [esx_inventory](https://esx-fivem.com/docs/core/esx_inventory): esx_inventory is the default ESX Legacy NUI inventory. Learn its config, keybinds, the server storage API exports and how it relates to ox_inventory. - [esx_menu_default](https://esx-fivem.com/docs/core/esx_menu_default): esx_menu_default reference for ESX Legacy. Build keyboard list menus with ESX.UI.Menu.Open, sliders, element fields, menu methods, keybinds and fixes. - [esx_menu_dialog](https://esx-fivem.com/docs/core/esx_menu_dialog): esx_menu_dialog reference for ESX Legacy. Ask players for a text or number value with ESX.UI.Menu.Open('dialog'), data fields, callbacks and input rules. - [esx_menu_list](https://esx-fivem.com/docs/core/esx_menu_list): esx_menu_list reference for ESX Legacy. Show table menus with clickable row buttons via ESX.UI.Menu.Open('list'), the head/rows format, callbacks and pitfalls. - [esx_multicharacter](https://esx-fivem.com/docs/core/esx_multicharacter): esx_multicharacter gives ESX Legacy players multiple characters per account. Config, slot commands, database tables, events and fixes for common errors. - [esx_notify](https://esx-fivem.com/docs/core/esx_notify): esx_notify reference for ESX Legacy. Show NUI notifications with ESX.ShowNotification, the Notify export or server events, plus types, positions and config. - [esx_progressbar](https://esx-fivem.com/docs/core/esx_progressbar): esx_progressbar reference for ESX Legacy. Show timed progress bars with animations, freeze, onFinish and onCancel via ESX.Progressbar or the export. - [esx_skin](https://esx-fivem.com/docs/core/esx_skin): esx_skin is the ESX Legacy character creator and appearance saver. Server exports, client menu events, config keys, the /skin command and save errors explained. - [skinchanger](https://esx-fivem.com/docs/core/skinchanger): skinchanger applies and reads ESX Legacy ped appearance on the client. All exports, events, skin keys and component config for freemode peds. - [esx_textui](https://esx-fivem.com/docs/core/esx_textui): esx_textui reference for ESX Legacy. Show a persistent help prompt like "Press E to open" with ESX.TextUI and ESX.HideUI, types, events and pitfalls. - [esx_whitelist](https://esx-fivem.com/docs/core/esx_whitelist): Set up esx_whitelist for ESX Legacy. Identifier and Discord role whitelist, admin-only mode, bypass list, in-game panel, commands, config and SQL. - [esx_loadingscreen](https://esx-fivem.com/docs/core/esx_loadingscreen): esx_loadingscreen for ESX Legacy explained. How the loading screen works, how to change the logo, tips and texts, and how shutdown with multicharacter works. - [esx_chat_theme](https://esx-fivem.com/docs/core/esx_chat_theme): esx_chat_theme for ESX Legacy explained. What the ESX chat theme changes, how it hooks into the cfx chat resource, and how to customize or remove it. - [cron](https://esx-fivem.com/docs/core/cron): cron reference for ESX Legacy. Schedule daily server tasks at a fixed time with the cron:runAt event, weekday handling, timezone and common pitfalls. - Addons - [ESX Legacy Addons](https://esx-fivem.com/docs/addons): Overview of all 39 official ESX Legacy addons with categories, dependencies, installation order and the 2026 security hardening SQL migration. - [esx_accessories](https://esx-fivem.com/docs/addons/esx_accessories): Set up esx_accessories for ESX Legacy. Covers mask, helmet, glasses and ear shops, the datastore SQL, every config key, server events, callbacks and the J keybind. - [esx_accessorymanager](https://esx-fivem.com/docs/addons/esx_accessorymanager): esx_accessorymanager adds a radial wardrobe to ESX Legacy for taking off and restoring clothing and props. Config keys, client exports, F11 keybind and setup. - [esx_addonaccount](https://esx-fivem.com/docs/addons/esx_addonaccount): esx_addonaccount stores extra money accounts such as society funds in ESX Legacy. Covers SQL setup, the account object, exports, events and pitfalls. - [esx_addoninventory](https://esx-fivem.com/docs/addons/esx_addoninventory): esx_addoninventory stores items for societies and properties in ESX Legacy. SQL setup, inventory object, exports, events and ox_inventory stash behavior. - [esx_adminmenu](https://esx-fivem.com/docs/addons/esx_adminmenu): Complete guide to esx_adminmenu for ESX Legacy. Permissions, all config sections, commands, bans, admin action logs, Discord webhook and server exports. - [esx_ambulancejob](https://esx-fivem.com/docs/addons/esx_ambulancejob): Set up esx_ambulancejob for ESX Legacy. EMS job with revive, heal, pharmacy and job vehicles, plus config keys, server events, callbacks and common issues. - [esx_animations](https://esx-fivem.com/docs/addons/esx_animations): esx_animations adds an emote menu to ESX Legacy with animations, scenarios and walk styles. Keybinds, Config.Animations format and GetConfig/SetConfig. - [esx_banking](https://esx-fivem.com/docs/addons/esx_banking): esx_banking adds banks, ATMs, PIN codes, transfers and transaction history to ESX Legacy. Config defaults, the logTransaction export and security model. - [esx_barbershop](https://esx-fivem.com/docs/addons/esx_barbershop): Install and configure esx_barbershop for ESX Legacy. Hair, beard and makeup changes via esx_skin, all config keys, the pay callback, refund logic and common fixes. - [esx_basicneeds](https://esx-fivem.com/docs/addons/esx_basicneeds): esx_basicneeds adds hunger and thirst to ESX Legacy. Learn how to add food and drink items, the /heal command, events, config keys and how statuses drain. - [esx_billing](https://esx-fivem.com/docs/addons/esx_billing): esx_billing lets ESX Legacy jobs send invoices and fines that players pay from cash or bank. Config, sendBill event, exports, callbacks and security limits. - [esx_boat](https://esx-fivem.com/docs/addons/esx_boat): esx_boat adds a boat shop, a boat license and six boat garages to ESX Legacy. Covers setup, every config key, callbacks, the getGarages export and pitfalls. - [esx_clotheshop](https://esx-fivem.com/docs/addons/esx_clotheshop): esx_clotheshop adds 14 clothing stores to ESX Legacy. Configure prices, per-piece charging and saved outfits, and learn the server callback and its checks. - [esx_cruisecontrol](https://esx-fivem.com/docs/addons/esx_cruisecontrol): esx_cruisecontrol adds cruise control and a seatbelt with ejection to ESX Legacy. Covers keybinds, config keys, the isSeatbeltOn export and HUD integration. - [esx_datastore](https://esx-fivem.com/docs/addons/esx_datastore): esx_datastore stores JSON data per player or per society in ESX Legacy. Learn the tables, the get/set store API, server events and autosave behavior. - [esx_death](https://esx-fivem.com/docs/addons/esx_death): esx_death handles death state, the death screen, respawn timers, penalties and revives in ESX Legacy. Config keys, exports, events and /revive explained. - [esx_dmvschool](https://esx-fivem.com/docs/addons/esx_dmvschool): esx_dmvschool adds a theory test and car, motorcycle and truck driving tests to ESX Legacy. Covers licenses, config keys, checkpoints, events and common issues. - [esx_drugs](https://esx-fivem.com/docs/addons/esx_drugs): esx_drugs lets players harvest cannabis, process it into marijuana and sell it for black money in ESX Legacy. Config, items, events and anti-exploit checks. - [esx_garage](https://esx-fivem.com/docs/addons/esx_garage): Configure esx_garage 2.0 for ESX Legacy: garages, impound lots, job access, settings, server exports like registerGarage and impoundVehicle, and fixes. - [esx_hud](https://esx-fivem.com/docs/addons/esx_hud): esx_hud is the default ESX Legacy HUD with status bars, money, job, speedometer, indicators and saved mileage. Config keys, exports and events. - [esx_joblisting](https://esx-fivem.com/docs/addons/esx_joblisting): Set up esx_joblisting, the ESX Legacy job center. Hide whitelisted jobs, customize job cards, and use the UpdateJobProgress and ShowTasks exports. - [esx_jobs](https://esx-fivem.com/docs/addons/esx_jobs): Configure esx_jobs for ESX Legacy, the miner, lumberjack, fisherman, fueler, slaughterer and tailor jobs. Zone format, vehicle deposits, events and fixes. - [esx_license](https://esx-fivem.com/docs/addons/esx_license): esx_license stores player licenses such as driving, weapon and boat licenses in ESX Legacy. Server events, client callbacks, permissions and SQL explained. - [esx_lscustom](https://esx-fivem.com/docs/addons/esx_lscustom): esx_lscustom adds Los Santos Customs tuning to ESX Legacy with a cart-based NUI, live stats and server-validated prices. Setup, config, pricing and events. - [esx_mechanicjob](https://esx-fivem.com/docs/addons/esx_mechanicjob): Install and configure esx_mechanicjob for ESX Legacy. Repair kits, crafting, NPC towing missions, billing, config keys, server events and known issues. - [esx_optionalneeds](https://esx-fivem.com/docs/addons/esx_optionalneeds): esx_optionalneeds adds a drunk status and a usable beer item to ESX Legacy, with three drunk levels, walk styles and screen effects. Setup and API. - [esx_pausemenu](https://esx-fivem.com/docs/addons/esx_pausemenu): esx_pausemenu replaces the GTA pause screen with a branded ESX Legacy NUI menu showing character, money, job and links. Install and config guide. - [esx_policejob](https://esx-fivem.com/docs/addons/esx_policejob): Set up esx_policejob for ESX Legacy. Covers SQL, config keys, armory, job vehicles, handcuffs, fines, server events, callbacks and common issues. - [esx_property](https://esx-fivem.com/docs/addons/esx_property): esx_property lets ESX Legacy players buy, furnish and share houses with keys, garages, CCTV, raids and a real estate job. Setup, config, commands and exports. - [esx_rpchat](https://esx-fivem.com/docs/addons/esx_rpchat): esx_rpchat adds roleplay chat to ESX Legacy - /me and /do proximity messages, global OOC, /twt, /anontwt and private /msg with per-command rate limits. - [esx_scoreboard](https://esx-fivem.com/docs/addons/esx_scoreboard): esx_scoreboard is the ESX Legacy player list with job counts, search and live activities like robberies. Config keys and the AddActivity export API. - [esx_service](https://esx-fivem.com/docs/addons/esx_service): esx_service is the on/off duty system for ESX Legacy jobs. It limits how many players are on duty, tracks counts in GlobalState and notifies colleagues. - [esx_shops](https://esx-fivem.com/docs/addons/esx_shops): esx_shops adds 24/7, liquor and LTD stores with a cart-based NUI to ESX Legacy. Covers setup, config keys, tax, shop zones, exports and pitfalls. - [esx_society](https://esx-fivem.com/docs/addons/esx_society): esx_society adds shared job accounts, the boss menu, hiring, salaries, grade labels, uniforms and money washing to ESX Legacy. Full API and config reference. - [esx_status](https://esx-fivem.com/docs/addons/esx_status): esx_status stores and syncs player needs like hunger, thirst and drunk in ESX Legacy. Covers the server-authoritative model, config, events and examples. - [esx_taxijob](https://esx-fivem.com/docs/addons/esx_taxijob): Set up esx_taxijob for ESX Legacy. NPC taxi missions, payout split, billing, config keys with defaults, server events, callbacks and fixes for common issues. - [esx_vehicleshop](https://esx-fivem.com/docs/addons/esx_vehicleshop): esx_vehicleshop adds the Premium Deluxe Motorsport dealership to ESX Legacy, with direct sales or a car dealer job, rentals and reselling. Setup and API. - [esx_weaponshop](https://esx-fivem.com/docs/addons/esx_weaponshop): esx_weaponshop adds Ammu-Nation and a black market dealer with a NUI, weapon license, ammo, attachments and tints to ESX Legacy. Setup, config and API. - [esx_weather](https://esx-fivem.com/docs/addons/esx_weather): esx_weather syncs weather and time per zone (Los Santos, Sandy Shores, Paleto Bay) on ESX Legacy, with an admin panel, persistence and sync toggle exports. - Guides - [Create a Job](https://esx-fivem.com/docs/guides/create-a-job): How to create a job in ESX Legacy step by step, with jobs and job_grades SQL, ESX.CreateJob at runtime, /refreshjobs, /setjob and an esx_society boss menu. - [Add Items](https://esx-fivem.com/docs/guides/add-items): How to add items in ESX Legacy, with the items table SQL, weight, rare and can_remove, ESX.AddItems, usable items via ESX.RegisterUsableItem and ox_inventory notes. - [Admin Permissions](https://esx-fivem.com/docs/guides/admin-permissions): How to become admin in ESX Legacy, using users.group, /setgroup, ACE permissions in server.cfg, Config.CommandPermissions and custom admin-only commands. - [Money and Accounts](https://esx-fivem.com/docs/guides/money-and-accounts): How money works in ESX Legacy, covering cash, bank and black_money accounts, xPlayer account methods, starting money, paychecks, society money and custom accounts. - [Callbacks](https://esx-fivem.com/docs/guides/callbacks): How to use server and client callbacks in ESX Legacy, with callback and await (promise) styles, timeouts, rate limits and server-side validation. - [Using oxmysql](https://esx-fivem.com/docs/guides/oxmysql): How to use oxmysql with ESX Legacy, covering query, single, scalar, insert, update, prepare and transactions with await, plus migration from mysql-async. - [Using ox_inventory](https://esx-fivem.com/docs/guides/ox-inventory): How to run ox_inventory with ESX Legacy, covering start order, convars, how es_extended switches to ox mode, which xPlayer methods change, and pitfalls. - [Convert Old ESX Scripts](https://esx-fivem.com/docs/guides/convert-old-esx-scripts): How to convert ESX 1.1, 1.2 and v1-final scripts to ESX Legacy, from getSharedObject and fxmanifest to mysql-async, xPlayer changes and events. - [ESX vs QBCore](https://esx-fivem.com/docs/guides/esx-vs-qbcore): A neutral comparison of ESX Legacy and QBCore for FiveM servers covering architecture, data storage, API style, ecosystem, learning curve and migration. - [Database Schema](https://esx-fivem.com/docs/guides/database-schema): Every ESX Legacy database table explained with columns, types, keys and the resources that use them, from users and jobs to billing, banking and owned_vehicles. - [Performance](https://esx-fivem.com/docs/guides/performance): Optimize an ESX Legacy server with resmon and the profiler, smarter thread waits, state bags instead of events, database indexes, paycheck batching and OneSync. - [ESX Legacy FAQ](https://esx-fivem.com/docs/faq): Answers to the most common ESX Legacy questions - installation, current version, OneSync, oxmysql, admin rights, giving money, adding items and getting xPlayer.