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.
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)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.
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.
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.
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.
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.
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.
esx_lib resource. Naming your version is what stops a script working on your test server and failing on production.Database access always goes through oxmysql with parameterized queries — never mysql-async or ghmattimysql, which are unmaintained and slow.
Running QBCore or Qbox? Generate against qb-core instead.
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.
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.
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.
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.
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.
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.
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.
The FiveM overview covers every framework Codella targets; the ideas page is a list of scripts described precisely enough to build.