Sell Shops
Sell Shops is a server-side system built into the bridge that lets players sell items for cash through a stash-style inventory UI. You register a shop with accepted items and prices, then open it for a player; the system handles the rest.
How it works
- You register a sell shop with a unique ID, label, and a table of items and prices.
- When a player opens the shop, they see a stash inventory.
- When they move an item from their inventory into the shop stash, the item is consumed and they receive cash (price × quantity).
- The shop stash is cleared after each transaction.
Under the hood
Sell shops use the inventory stash system. A hook intercepts the item move and handles payment and cleanup automatically.
Server exports
RegisterSellShop
Registers a new sell shop. Call this before opening the shop for any player.
exports["prp-bridge"]:RegisterSellShop(id, payload)| Parameter | Type | Description |
|---|---|---|
id | string | Unique shop identifier. |
payload | table | Config (see below). |
Payload
| Field | Type | Required | Description |
|---|---|---|---|
label | string | Yes | Name shown in the stash UI. |
items | table | Yes | Sellable items (see Items). |
reason | string | No | Reason used for logging. |
coords | vector3 | No | Shop location. |
Items
Keyed by item name. Each entry has label and price.
items = {
["gold_bar"] = { label = "Gold Bar", price = 500 },
["silver_bar"] = { label = "Silver Bar", price = 200 },
}| Field | Type | Description |
|---|---|---|
label | string | Display name (e.g. in notifications). |
price | number | Cash per unit sold. |
Unlisted items
Items not in the items table cannot be sold. Moving an unlisted item into the stash shows an error and leaves the item in the player’s inventory.
OpenSellShop
Opens a registered sell shop for a player.
exports["prp-bridge"]:OpenSellShop(source, id)| Parameter | Type | Description |
|---|---|---|
source | number | Player server ID. |
id | string | Shop ID used in RegisterSellShop. |
Re-registering
If the shop is already registered, calling RegisterSellShop again with the same ID does nothing. You can safely call it in the same handler as OpenSellShop.
Examples
Basic sell shop
exports["prp-bridge"]:RegisterSellShop("my_shop", {
label = "Pawn Shop",
items = {
["gold_ring"] = { label = "Gold Ring", price = 150 },
["silver_chain"] = { label = "Silver Chain", price = 75 },
["diamond"] = { label = "Diamond", price = 1000 },
}
})
RegisterNetEvent("myresource:openShop", function()
local src = source
exports["prp-bridge"]:OpenSellShop(src, "my_shop")
end)Dynamic items from config
Build the items table from your resource config at startup (common pattern in Prodigy resources).
local sellingItems = {}
for itemName, itemData in pairs(Config.Items) do
if itemData.sellPrice then
sellingItems[itemName] = {
label = itemData.label,
price = itemData.sellPrice,
}
end
end
exports["prp-bridge"]:RegisterSellShop("mining", {
label = "Sell Materials",
items = sellingItems
})
RegisterNetEvent("mining:openSellShop", function()
exports["prp-bridge"]:OpenSellShop(source, "mining")
end)With ped interaction
Pair a sell shop with a ped interaction so players sell at an NPC.
-- Client
exports["prp-bridge"]:AddPedInteraction("shop_npc", {
model = "s_m_m_strvend_01",
coords = vector3(100.0, 200.0, 30.0),
heading = 180.0,
radius = 40.0,
scenario = "WORLD_HUMAN_STAND_IMPATIENT",
options = {
{
icon = "fas fa-cart-shopping",
label = "Sell Items",
distance = 2.0,
onSelect = function()
TriggerServerEvent("myresource:openShop")
end
}
}
})
-- Server
exports["prp-bridge"]:RegisterSellShop("my_shop", {
label = "Sell Items",
items = {
["fish_bass"] = { label = "Bass", price = 25 },
["fish_salmon"] = { label = "Salmon", price = 40 },
}
})
RegisterNetEvent("myresource:openShop", function()
exports["prp-bridge"]:OpenSellShop(source, "my_shop")
end)