Exports · origen_tradingcards
All exports are registered under the resource name origen_tradingcards.
Client-side exports
albumcard(itemData) — use a card item
Triggered automatically when a player uses any albumcard* item from their inventory. Shows a menu with options to save the card to the album or display it to nearby players.
exports['origen_tradingcards']:albumcard(itemData)This export is wired directly in each card item's client.export field. You do not need to call it manually.
album(itemData) — open the album UI
Triggered when a player uses the album item. Opens the full collection UI for the album linked to that item's metadata.
exports['origen_tradingcards']:album(itemData)This export is wired directly in the album item's client.export field. You do not need to call it manually.
albumpack(itemData) — open a card pack
Triggered when a player uses the albumpack item. Sends a server request to open the pack and deliver cards.
exports['origen_tradingcards']:albumpack(itemData)This export is wired directly in the albumpack item's client.export field. You do not need to call it manually.
CreateCardMenu() — open the card creation form
Opens an input form that lets the current player create a new card. Useful for business scripts where a specific NPC or object should grant card creation access.
exports['origen_tradingcards']:CreateCardMenu()Example — bind to an ox_target zone:
exports['ox_target']:addBoxZone({
coords = vector3(100.0, 200.0, 30.0),
size = vector3(1.0, 1.0, 2.0),
options = {
{
label = 'Create Card',
onSelect = function()
exports['origen_tradingcards']:CreateCardMenu()
end,
}
}
})The form prompts for: card name, description, image URL, rarity, and the target album.
CreateAlbumMenu() — open the album creation menu
Opens a menu with options to create a new album or print copies of an existing one.
exports['origen_tradingcards']:CreateAlbumMenu()Options presented:
- Create Album — prompts for internal name, display label, and cover image URL
- Print Album — prompts for album selection and quantity, then adds the item to the player's inventory
CreatePackMenu() — open the pack generation form
Opens an input form to generate card packs for a specific album and deliver them to the player's inventory.
exports['origen_tradingcards']:CreatePackMenu()The form prompts for: album selection and quantity.
Server-side exports
OpenAdminMenu(playerId) → opens the admin panel for a player
Triggers the full admin panel UI on the client of the specified player. The target player does not need admin permissions — permission enforcement is the caller's responsibility.
exports['origen_tradingcards']:OpenAdminMenu(playerId)| Parameter | Type | Description |
|---|---|---|
playerId | number | Server ID of the player who will see the admin panel |
Example — open admin panel from a server command:
RegisterCommand('openadmin', function(source, args)
local targetId = tonumber(args[1]) or source
exports['origen_tradingcards']:OpenAdminMenu(targetId)
end, true)