Custom PED System
Configuration
Everything lives in config.lua. Set your framework once at the top, then define as many vendors as you need in Config.Vendors.
Framework
config.lua
Config.Framework = 'esx' -- 'esx' or 'qbcore'
Vendor fields
| Field | Type | Description |
|---|---|---|
| shopType | string | Unique identifier for this vendor's shop. Must be different for each vendor. |
| pedModel | hash | The ped model to spawn. Use backtick hash syntax: `a_f_y_tourist_01`. Full list at fivem.net/docs. |
| pedCoords | vector4 | Spawn location and heading: vector4(x, y, z, heading). |
| vendorName | string | Optional. Name shown in the shop UI title bar. Defaults to 'Vendor Shop'. |
| targetLabel | string | Optional. ox_target interaction label. Defaults to 'Talk to Vendor'. |
| allowedIdentifier | string | Single identifier/citizenid allowed to access this vendor. Use this or allowedIdentifiers, not both. |
| allowedIdentifiers | table | Table of identifiers — for vendors shared between multiple players. |
| shopItems | table | List of items the vendor sells. Each entry needs name, label, and price. |
Single-player vendor
Use allowedIdentifier to lock the vendor to exactly one player.
config.lua
Config.Vendors = {
{
shopType = 'my_vendor_1',
vendorName = 'Maria\'s Shop',
targetLabel = 'Browse Shop',
pedModel = `a_f_y_tourist_01`,
pedCoords = vector4(-1047.48, -519.83, 36.04, 304.79),
allowedIdentifier = "char1:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
shopItems = {
{ name = 'water', label = 'Water', price = 30 },
{ name = 'sandwich', label = 'Sandwich', price = 50 },
{ name = 'ecola', label = 'Ecola', price = 30 },
}
},
}
Multi-player vendor
Use allowedIdentifiers (a table) to share one vendor between multiple players.
config.lua
{
shopType = 'gang_vendor',
pedModel = `a_f_y_business_01`,
pedCoords = vector4(-1075.66, -468.73, 36.51, 118.36),
allowedIdentifiers = {
"char1:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"char1:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
},
shopItems = {
{ name = 'water', label = 'Water', price = 30 },
}
},
Adding more vendors
Copy any vendor block, paste it inside Config.Vendors, and update the fields. The only rules are that each shopType must be unique, and you use either allowedIdentifier or allowedIdentifiers — not both on the same vendor.
Item images in the shop UI are loaded from
nui://ox_inventory/web/images/<name>.png automatically. If an image is missing it gracefully shows a placeholder — no errors.Item tab categories
The shop UI automatically groups items into tabs based on their name field:
| Tab | Matched when name… |
|---|---|
| Weapons | starts with weapon_ |
| Ammo | contains ammo or bullet |
| Items | everything else |
Tabs only appear if the vendor has at least one item in that category — an items-only vendor won't show Weapons or Ammo tabs.