FixFX

ESX

The ESX framework for FiveM servers.

ESX (ExtendedScript) is one of the most popular frameworks for FiveM servers, providing a comprehensive system for roleplay servers with a player-centric architecture.

Overview

ESX is a lightweight, extensible framework that provides essential systems for FiveM roleplay servers:

  • Player Management - Character data persistence and multi-character support
  • Economy System - Multi-currency support with banking and transactions
  • Job Framework - Dynamic jobs with grade-based hierarchy and society systems
  • Inventory Management - Weight-based inventory with item categorization
  • Vehicle System - Ownership, garages, and modification persistence
  • Property Systems - Real estate and storage management

Key Features

Users

Player Management

Comprehensive character system with persistent data, multi-character support, and identity management.

Briefcase

Job System

Dynamic job assignment with grades, salaries, and society banking for organizations.

DollarSign

Economy

Multi-currency economy with cash, bank, and black money systems plus transaction logging.

Package

Inventory

Weight-based inventory system with item categories and vehicle/property storage.

Car

Vehicles

Complete vehicle ownership system with garages, modifications, and impound functionality.

Building

Properties

Property ownership with customizable interiors and storage systems.

Getting Started

Quick Start

Basic ESX Integration

-- Get ESX object (modern method)
ESX = exports['es_extended']:getSharedObject()
 
-- Player management
local xPlayer = ESX.GetPlayerFromId(source)
local playerData = ESX.GetPlayerData() -- Client-side
 
-- Economy operations
xPlayer.addMoney(1000)
xPlayer.removeAccountMoney('bank', 500)
 
-- Inventory management
xPlayer.addInventoryItem('bread', 5)
local itemCount = xPlayer.getInventoryItem('water').count
 
-- Job system
xPlayer.setJob('police', 2)
if xPlayer.job.name == 'police' then
    -- Police-specific code
end

Essential Events

-- Player loaded (client)
RegisterNetEvent('esx:playerLoaded', function(xPlayer)
    ESX.PlayerData = xPlayer
    -- Initialize client-side systems
end)
 
-- Job changed (client)
RegisterNetEvent('esx:setJob', function(job)
    ESX.PlayerData.job = job
    -- Update UI/permissions
end)
 
-- Player loaded (server)
AddEventHandler('esx:playerLoaded', function(playerId, xPlayer)
    -- Server-side player initialization
end)

Architecture

ESX follows a modular architecture where each system is handled by separate resources:

  • es_extended - Core framework
  • esx_society - Organization management
  • esx_datastore - Data persistence
  • esx_menu_* - UI menu systems
  • Job Resources - Police, ambulance, mechanic jobs
  • Economy Resources - Shops, banks, real estate

Community

ESX Legacy is the official successor to the original ESX framework, featuring improved performance, better security, and active maintenance.

Always test ESX resources and modifications on a development server before deploying to production.

On this page