ESX Legacy · es_extended 1.10 – 1.15

ESX script generatorfrom a sentence to a resource.

Describe the script and Codella writes it against ESX Legacy as it exists today — xPlayer methods, server callbacks, useable items, jobs and grades, society accounts — with the SQL it needs, the inventory you run, and menus from ox_lib or the classic ESX menus.

  • ESX Legacy 1.10+
  • Full source
  • SQL included
server/main.lua
local ESX = exports['es_extended']:getSharedObject()ESX.RegisterServerCallback('codella_shop:buy', function(source, cb, item, amount)  local xPlayer = ESX.GetPlayerFromId(source)  local price = Config.Items[item]  amount = math.floor(tonumber(amount) or 0)  if not xPlayer or not price or amount < 1 then return cb(false) end  if xPlayer.getMoney() < price * amount then return cb(false) end  if not xPlayer.canCarryItem(item, amount) then return cb(false) end  xPlayer.removeMoney(price * amount, 'shop')  xPlayer.addInventoryItem(item, amount)  cb(true)end)
What it generates

Complete ESX resources, written for current es_extended.

Most broken ESX scripts on the forums were written for an API that no longer exists: the shared-object event, the old menus, mysql-async. These are the parts the generator writes against the current source.
  1. xPlayer, used the way es_extended defines it

    ESX.GetPlayerFromId on the server, xPlayer.getMoney and addMoney for cash, getAccount('bank') and addAccountMoney for accounts, getInventoryItem, canCarryItem, getJob, setJob, showNotification — with the account names ESX actually uses: money, bank and black_money.

  2. Server callbacks and client data

    ESX.RegisterServerCallback on the server, ESX.TriggerServerCallback on the client (or lib.callback with the ox stack), and ESX.PlayerData read only after esx:playerLoaded, with the resource-restart case handled so the script works after a live restart too.

  3. Items and useable items

    SQL inserts for the items table or entries in ox_inventory's items file, ESX.RegisterUsableItem or the ox_inventory useable exports, weight checks before giving, and removal verified before any reward is added.

  4. Jobs, grades and societies

    jobs and job_grades inserts with salaries and labels, grade-gated actions, boss-only menus, esx_addonaccount society accounts for deposits and payouts, and esx_billing invoices when the script bills players.

  5. Vehicles and garages

    ESX.Game.SpawnVehicle with vehicle properties, plates trimmed the way owned_vehicles stores them, ownership checked against the owner identifier, and fuel and keys through the resources you name.

  6. Menus, notifications and prompts

    ox_lib context menus and input dialogs by default; ESX.OpenContext, esx_menu_default and esx_menu_dialog when you ask for the classic look; ESX.ShowNotification, ESX.TextUI and help prompts wired to the current esx_notify and esx_textui signatures.

Version targeting

ESX Legacy changed under the scripts written for it.

The shared-object event went from deprecated to gone, the context menu system arrived, and 1.14 split shared helpers into a separate esx_lib resource. Naming your version is what stops a script working on your test server and failing on production.
1.10 – 1.11
getSharedObject export, xPlayer.getMeta
1.12 – 1.13
Legacy warnings, context menus
1.14 – 1.15
esx_lib required, current API
Inventory
Default ESX · ox_inventory

Database access always goes through oxmysql with parameterized queries — never mysql-async or ghmattimysql, which are unmaintained and slow.

Default inventory or ox_inventory

Which inventory should the script target?

The two are not interchangeable: items live in different places, useable items register differently, and weapons are loadout entries in one and items in the other.
Default ESX inventory

The stock setup

  • Items in the items SQL table, useable items through ESX.RegisterUsableItem.
  • xPlayer.addInventoryItem, removeInventoryItem and canCarryItem for everything.
  • The right choice for a fresh ESX Legacy install without extra inventory resources.
ox_inventory

What most servers run

  • Items in ox_inventory/data/items.lua with images, metadata and durability.
  • Useable items via ox_inventory exports; stashes, shops and crafting built in.
  • Worth it when your server already runs the ox stack — the script uses its exports directly.

Running QBCore or Qbox? Generate against qb-core instead.

Try it

Describe your ESX script.

Name your ESX version, the inventory and target resources you run, the job names and grades, the locations and the prices. That is a complete brief.
Your prompt

An ESX Legacy 1.13 fishing job with ox_lib and ox_target: rent a boat at the pier, catch fish with a progress bar and random yields, sell to a buyer ped with fluctuating prices, and a 15% cut to the fishing society account.

FAQ

Questions about generating ESX scripts

Which ESX versions does the generator target?

ESX Legacy from 1.10 through the current 1.15 releases. It gets the shared object with exports['es_extended']:getSharedObject() or the imports file, never the removed esx:getSharedObject event, and it uses the xPlayer methods, ESX.RegisterServerCallback and the esx:playerLoaded and esx:setJob events as they exist in the current es_extended source.

Does it work with ox_inventory on ESX?

Yes. When you say ox_inventory it writes items in ox_inventory/data/items.lua, handles useable items through ox_inventory exports instead of ESX.RegisterUsableItem, and uses the inventory exports for stashes, shops and counts. With the default ESX inventory it uses the items SQL table, xPlayer.addInventoryItem and RegisterUsableItem.

Can it handle jobs, grades and society money?

Yes. Jobs and job_grades SQL inserts, job checks against ESX.PlayerData.job on the client and xPlayer.job on the server, esx:setJob handlers for mid-session changes, and society money through esx_addonaccount shared accounts and esx_society — the way the official esx_addons do it.

Which menus does it use?

ox_lib context menus, input dialogs and progress bars by default, because that is what most ESX servers run today. If you want the classic esx_menu_default and esx_menu_dialog menus, or ESX.OpenContext from ESX Legacy, say so and it uses those APIs exactly.

What files do I actually get?

A complete resource folder: fxmanifest.lua, config.lua, client and server Lua files, locales, an sql/install.sql with the tables, job and item inserts the script needs, an html folder when it has a NUI, and a README with the ensure line and dependencies. Download the folder and put it in your resources directory.

Is it free to generate an ESX script?

There are free credits that refresh daily, which is enough to build and iterate on a script without paying. Larger resources and heavier refinement use more credits; the pricing page lists what each plan includes.

Related

The FiveM overview covers every framework Codella targets; the ideas page is a list of scripts described precisely enough to build.

© 2026 Codella AI - All rights reserved.