esx-framework
Develops resources for FiveM using the ESX Framework (Legacy). Covers resource creation, Core Object (ESX), xPlayer functions, Events, Callbacks, Items, Jobs, Database (oxmysql), and best practices. Use when the user works with FiveM, ESX, ESX Legacy, or mentions `ESX.GetCoreObject`, `xPlayer`, `ESX.GetPlayerFromId`, or `esx:`.
How do I install this agent skill?
npx skills add https://github.com/proelias7/fivem-skill --skill esx-frameworkIs this agent skill safe to install?
- Gen Agent Trust Hubpass
This skill provides documentation, best practices, and code templates for developing FiveM game resources using the ESX Framework. It contains only instructional material and code snippets intended for game development.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
- Runlayerpass
5 files scanned · No issues
- ZeroLeakspass
2 findings · Score: 80/100
What does this agent skill do?
ESX Framework Development
Language rule: Internal reasoning is in compact English. All messages and output displayed to the user must be in the user's language.
This skill provides guidelines and patterns for developing resources using the ESX Framework (Legacy).
1. Core Object Retrieval
ESX Legacy (New Way):
local ESX = exports["es_extended"]:getSharedObject()
Legacy / Backwards Compatible:
local ESX = nil
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
2. Key Concepts
Player Data (Server-side)
- xPlayer: The main object for player interaction server-side.
- ESX.GetPlayerFromId(source): Retrieves the xPlayer object.
- xPlayer Methods:
xPlayer.addMoney,xPlayer.setJob,xPlayer.addInventoryItem.
Callbacks (Server -> Client Data)
- ESX.RegisterServerCallback (Server): Respond to client requests.
- ESX.TriggerServerCallback (Client): Request data from server.
Items & Database
- Items are defined in the database (
itemstable) orox_inventory. - Database typically uses oxmysql.
3. Standard Resource Structure
my-resource/
├── fxmanifest.lua
├── config.lua
├── client/
│ └── main.lua
├── server/
│ └── main.lua
└── locales/
└── en.lua
4. Best Practices
- Use New Exports: Prefer
exports["es_extended"]:getSharedObject()over the event trigger. - Validate xPlayer: Always check
if xPlayer thenbefore using it. - Secure Events: Use
ESX.SecureNetEvent(if available) or manual checks. - OneSync: Develop with OneSync Infinity in mind (server-side entity creation).
5. Documentation
- Official Docs: https://documentation.esx-framework.org/
- Github: https://github.com/esx-framework/esx_core
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/proelias7/fivem-skill/esx-framework">View esx-framework on skillZs</a>