Overview
What Legacy Shops is and how it works.
legacy-shops
legacy-shops is an in-game shop creator and store system for FiveM. It lets admins build and place fully-configurable shops (peds, blips, categories, items, pricing, job/licence gates) via an in-game NUI creator, and lets players interact with those shops through a storefront NUI.
Core pieces
- Admin creator UI — opened via the
OpenCreatorclient export, thelegacy-shops:openCreatorclient event, or theConfig.CreatorCommandchat command. Lets admins create/edit shops, categories, items and reusable presets (shop templates), and place peds in the world with a free-look placement tool. - Storefront UI — opened via the
OpenStore(shopId)client export. Fetches a shop's categories, items (with live fluctuated prices and stock) and the player's balances, and lets them purchase items. - Presets — reusable shop templates (
legacy_shops_presets/server/presets.lua). A shop created from a preset stays linked to it (preset_id); editing the preset later re-syncs every linked shop's item catalogue (but preserves stock counts). - Economy loops — optional automatic restocking (
Config.RestockEnabled) and price fluctuation (Config.FluctuationEnabled) running on independent timers. - Access control — shops can be job/grade-locked (
groups), and individual items can require a licence (metadata.licences) or minimum job grade, and can be priced in an alternate currency backed by an inventory item (e.g.black_money) instead of cash/bank. - Persistence — shop/category/item/preset state lives in
data/shops.json(rewritten in full on every mutation); purchase history is appended to the SQL tablelegacy_shops_history. On first boot, ifdata/shops.jsondoesn't exist, existing SQL tables (legacy_shops,legacy_shops_categories,legacy_shops_items,legacy_shops_presets) are migrated into it once. - Webhooks — Discord webhook logging for shop create/edit/delete, item purchases, and restock events, configured in
Config.Webhooks.
Dependencies
legacy-shops requires legacy-lib, ox_lib, and oxmysql to be installed and started first.
Support
Full hosted documentation: https://legacy-docs.vercel.app/ Support/Discord: https://discord.gg/P2Jujr3Khh
