esx-framework
ESX Framework Development
Complete guide for developing with ESX Legacy Framework — the most trusted FiveM roleplay framework since 2017.
When to use
- Creating or editing ESX resources/scripts
- Working with player data (xPlayer, PlayerData)
- Implementing jobs, economy, inventory, or weapon systems
- Using ESX client/server functions, callbacks, or events
- Questions about ESX best practices and optimization
How to use
Read individual rule files for detailed explanations and examples:
-
rules/core-concepts.md — ESX architecture, PlayerData, xPlayer object, framework initialization
-
rules/client-functions.md — Client-side ESX functions, UI systems, player state management
-
rules/server-functions.md — Server-side functions, player retrieval, callbacks, triggers
-
rules/xplayer-methods.md — xPlayer object methods: money, items, weapons, inventory, jobs, metadata
-
rules/jobs-economy.md — Job system, salaries, accounts (money/bank), society management
-
rules/inventory-items.md — Inventory system, item management, usable items, weight calculations
-
rules/weapons-loadout.md — Weapon system, loadout, components, ammo, tints
-
rules/events-callbacks.md — ESX events, server callbacks, client callbacks, secure net events
-
rules/best-practices.md — ESX coding standards, optimization, security, naming conventions
-
rules/reference-links.md — Official ESX documentation links
Key principles
- Always check for nil —
if xPlayer then ... endbefore using xPlayer - Use ESX.GetPlayerFromId — Standard player retrieval:
local xPlayer = ESX.GetPlayerFromId(source) - Wait for player load — Check
ESX.IsPlayerLoaded()on client before accessing PlayerData - Never trust client — Validate all data server-side, use SecureNetEvent for client events
- Follow ESX patterns — Use ESX functions instead of reinventing (callbacks, notifications, etc.)
- Optimize loops — Cache player objects, avoid unnecessary GetPlayerFromId calls
- Use camelCase — Follow Lua naming:
myVariable,MyGlobalFunction,MY_CONSTANT - Minimal globals — Keep variables local unless they need global scope
- Use ox_lib for UI — Prefer ox_lib for menus, dialogs, notifications, progress bars instead of ESX UI
More from germanfndez/fiveai-skills
fivem-nui
FiveM NUI (New User Interface) development for creating graphical elements and user interfaces. Use when creating or editing NUI interfaces, HTML/CSS/JS for FiveM, or handling NUI callbacks.
101fivem-security
Best practices and rules for securing FiveM resources against cheaters and exploits. Use this skill when writing or reviewing server-side and client-side code to ensure malicious events, unauthorized entity creations, and client trust issues are prevented. Focuses on strict server authority and safe event handling.
85fivem-basics
FiveM resource structure, fxmanifest, client/server scripting, events. Use when creating or editing FiveM resources or Lua scripts, or when the user asks how FiveM works.
80lua-basics
Effective Lua programming for FiveM - functions, tables, variables, conditionals, error handling. Use when writing or reviewing Lua code for FiveM resources.
63fivemanage
Fivemanage SDK for FiveM — installation, screenshots (takeImage, takeServerImage, uploadImage), and centralized logs (Log, Info/Warn/Error). Use when integrating Fivemanage, capturing player screenshots, uploading images, or sending logs to the Fivemanage dashboard.
59skill-creator
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
35