esx-framework
FreeNo executable scriptsNot checkedTrigger: ESX, es_extended, xPlayer, PlayerData, ESX.GetPlayerFromId, ESX.RegisterServerCallback, ESX jobs, economy, inventory. Build ESX Legacy resources with…
by germanfndez★ 21 GitHub starsAbout this skill
ESX Framework
Server/client API for ESX Legacy: xPlayer, PlayerData, callbacks, events, jobs and money.
Activation Contract
Load this skill when the user creates or edits an ESX resource, touches xPlayer or ESX.PlayerData, needs jobs, money, accounts, items or weapons through ESX, or asks about ESX callbacks, events or best practices.
Hard Rules
- Get the object with
ESX = exports['es_extended']:getSharedObject(). On the client, wait forESXandESX.IsPlayerLoaded()before readingESX.PlayerData. xPlayerexists on the SERVER only (ESX.GetPlayerFromId(source)).ESX.PlayerDataexists on the CLIENT only.- Always nil-check:
if not xPlayer then return endbefore calling any method. - Money, items, weapons, jobs and metadata are mutated on the server through
xPlayer.*methods, never from the client. - Pass a
reasontoaddMoney,removeMoney,addAccountMoney,removeAccountMoney. - Client callbacks (
ESX.TriggerClientCallback,ESX.AwaitClientCallback) must never decide anything sensitive: the client can fake the answer. - Use
ESX.SecureNetEventfor client events that only the server may trigger. - Prefer ox_lib for notifications, menus, dialogs and progress bars over ESX UI.
- Cache
PlayerPedId()and update onesx:playerPedChanged; neverWait(0)loops without need.
Decision Gates
| Need | Use |
|---|---|
| Client asks server for data | ESX.RegisterServerCallback + ESX.TriggerServerCallback |
| Server pushes an event to one player | xPlayer.triggerEvent(name, ...) |
| Server-only client event | ESX.SecureNetEvent(name, cb) on the client |
| Find player by source / identifier | ESX.GetPlayerFromId / ESX.GetPlayerFromIdentifier |
| Filter players by job etc. | ESX.GetExtendedPlayers(key, value) |
| Usable item | ESX.RegisterUsableItem(item, cb) |
| Admin command with group | ESX.RegisterCommand(name, group, cb, allowConsole, suggestion) |
Execution Steps
- Confirm
es_extendedstarts before the resource; acquireESXper side. - Decide the side: mutation and validation on server, display on client.
- Fetch
xPlayer, nil-check, then validate every client-supplied argument. - Pick the call from Decision Gates; read the matching rules file for signatures.
- Return data via callbacks, not paired events.
Output Contract
Return runnable Lua with the client/server split explicit, xPlayer nil-checked, and reasons on money operations. Use ox_lib for UI unless the user asks otherwise.
References
- rules/core-concepts.md — architecture, PlayerData, xPlayer, startup flow.
- rules/client-functions.md — client-side ESX functions and player state.
- rules/server-functions.md — player retrieval, callbacks, commands, jobs, items.
- rules/xplayer-methods.md — xPlayer money, accounts, inventory, weapons, meta.
- rules/events-callbacks.md — server/client callbacks, events, SecureNetEvent.
- rules/best-practices.md — naming, caching, loops, security, Lua 5.4.
- rules/reference-links.md — official ESX documentation links.
Upstream docs: https://docs.esx-framework.org
Install esx-framework in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
FAQ
What does the esx-framework skill do?
Trigger: ESX, es_extended, xPlayer, PlayerData, ESX.GetPlayerFromId, ESX.RegisterServerCallback, ESX jobs, economy, inventory. Build ESX Legacy resources with server/client functions, xPlayer methods, callbacks and events.
How do I install the esx-framework skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the esx-framework skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
by Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
by Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
by Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
by Anthropic