Exports
Integrate Electus Black Market with your scripts
Client Exports
OpenBlackMarket
Open a specific black market by its market id.
exports["electus_black_market"]:OpenBlackMarket(marketId)| Prop | Description | Type |
|---|---|---|
| marketId | The configured black market id. | string |
OpenBlackMarketManager
Open the in-game black market manager UI. Server-side admin checks still apply to manager data saves and deletes.
exports["electus_black_market"]:OpenBlackMarketManager()Server Exports
RegisterBlackMarket
Register or replace a black market from another resource. Registered markets sync to all clients.
local success = exports["electus_black_market"]:RegisterBlackMarket({
id = "dock_drop",
label = "Dock Drop",
npc = {
model = "g_m_m_chicold_01",
coords = vector4(120.0, -3000.0, 7.0, 90.0),
scenario = "WORLD_HUMAN_SMOKING",
},
access = {
type = "public",
},
schedule = {
enabled = true,
startHour = 20,
endHour = 6,
},
items = {
{ id = "lockpick", item = "lockpick", label = "Lockpick", price = 450, amount = 1, maxStock24h = 25 },
},
})| Prop | Description | Type |
|---|---|---|
| market.id | Unique market id, 2 to 64 characters. | string |
| market.label | Display name. | string |
| market.npc.coords | NPC position and heading. | vector4 or table |
| market.schedule | Optional in-game hour availability. | table |
| market.items | Items, prices, amount per purchase, and optional 24 hour stock limits. | table[] |
| success | Returns true when the market was accepted. | boolean |
GetBlackMarkets
Return all loaded markets in manager format, including items and stock counters.
local markets = exports["electus_black_market"]:GetBlackMarkets()GetBlackMarket
Return one loaded market by id.
local market = exports["electus_black_market"]:GetBlackMarket("vespucci_drop")| Prop | Description | Type |
|---|---|---|
| id | Market id. | string |
| market | Returns the market table or nil. | table or nil |