# Orbit Studios Documentation (/docs) # Orbit Studios Documentation [#orbit-studios-documentation] Welcome to the official Orbit Studios documentation. These guides cover setup, configuration, and integration notes for Orbit Studios FiveM resources. ## Navigate the documentation [#navigate-the-documentation] ### Choose a resource [#choose-a-resource] Open a resource from the cards below or expand **Resources** in the left sidebar. Each resource has its own installation, configuration, integration, command, export, and troubleshooting pages where they are relevant. ### Start with installation and dependencies [#start-with-installation-and-dependencies] Read the resource's **Installation** page first, then open **Dependencies** before changing its configuration. These pages explain the required download, folder name, start order, supported integrations, and first-run checks. ### Follow the page outline [#follow-the-page-outline] Use the page outline to jump between sections in a longer guide. On smaller screens, open the navigation controls to reach the resource sidebar and page outline. ### Search across every guide [#search-across-every-guide] Use **Search** in the top navigation to find resource names, configuration keys, commands, exports, or error messages across the entire documentation site. ### Select your framework [#select-your-framework] Framework-specific instructions are grouped into **ESX**, **QB-Core**, **QBX**, and **Standalone** tabs. Select the tab that matches your server and use the same option throughout the documentation. ### Check file labels before editing [#check-file-labels-before-editing] Code-block titles show the file path where each example belongs. Read nearby callouts before replacing code, and use the resource's **Troubleshooting** page if the verification steps do not pass. ## Support and webstore [#support-and-webstore] For product and technical support, join the Orbit Studios Discord first. If Discord is unavailable, email `support@orbitstudios.net` and include the resource name, your framework, relevant console errors, and a short explanation of what you already tried. Every page is also available through `/llms.txt`, `/llms-full.txt`, and the copyable Markdown link in the page toolbar. ## Resource guides [#resource-guides] # Commands (/docs/orbit-studios-resources/orbit-craftingsystem/commands) # Commands [#commands] Commands are typed in the FiveM chat by a player with permission, or executed from the server console when supported. The crafting system currently exposes one developer command for giving blueprint items during setup and testing. ## Command availability [#command-availability] `createblueprint` is only available when developer mode is enabled. ```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua" Config.DeveloperMode = true ``` Turn developer mode back off after setup if you do not want this test command available on production servers. ## Parameters [#parameters] ```text title="FiveM console" /createblueprint 12 weapon_pistol /createblueprint 12 weapon_pistol 3 ``` The first example gives player ID `12` one blueprint that unlocks `weapon_pistol`. The second example gives the same player three blueprint items. `blueprintName` must match a key in `Config.Blueprints.items`, not the display label. If you use `Config.CustomBlueprints`, the command still receives the original blueprint content name, such as `weapon_pistol`. ## Permissions and production use [#permissions-and-production-use] The command is registered as restricted and developer-mode gated. If the chat suggestion appears but nothing happens, check the server console for the developer-mode warning first, then confirm the player running the command has permission to use restricted commands. `Config.DeveloperMode` can expose setup tooling intended for controlled testing. Set it back to `false`, restart the resource, and verify `/createblueprint` is unavailable before opening a production server. # Configuration (/docs/orbit-studios-resources/orbit-craftingsystem/configuration) # Configuration [#configuration] `orbit-craftingsystem` has two public config files. Use `shared/config.lua` for gameplay and recipes. Use `server/config.lua` for server-only logging, image paths, and Discord webhooks. Put craftable items, benches, stations, blueprints, XP, and access rules in `shared/config.lua`. Put webhook URLs and logging callbacks in `server/config.lua`. ## File map [#file-map] ## Setup workflow [#setup-workflow] ### Choose where the item belongs [#choose-where-the-item-belongs] Use a station item when the recipe should be available at a fixed world location. Use a bench non-blueprint item when the recipe should always be available on a portable bench. Use a blueprint item when players must own or install a blueprint first. ### Add the inventory items first [#add-the-inventory-items-first] Every final item and every required material must exist in your inventory or framework item list before testing. If the inventory does not know `metalscrap`, `steel`, or `weapon_pistol`, the crafting system cannot add or remove them correctly. ### Add one recipe and test it [#add-one-recipe-and-test-it] Add one recipe to `shared/config.lua`, restart the resource, open the station or bench, and test one craft. After that works, duplicate the same structure for the rest of your recipes. ### Enable logging [#enable-logging] Add your Discord webhook URL in `server/config.lua`, then keep or customize `Config.Server.OnCraft` and `Config.Server.SuspiciousActivity`. ## Shared config shape [#shared-config-shape] `shared/config.lua` is read in this order. Keeping the same order makes it much easier to compare your file with the shipped config when you update the resource. ```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua" Config = Config or {} Config.DeveloperMode = false Config.CraftingWithWheel = true Config.NuiState = function(bool) if not Config.DeveloperMode then return end print("NUI Open:", bool) end Config.Celebration = { animDict = "anim@mp_player_intcelebrationmale@air_guitar", animName = "air_guitar" } Config.BenchAnimations = { putting_down_bench = { duration = 5000, animDict = "amb@world_human_hammering@male@base", anim = "base", flag = 1 }, moving_bench = { duration = 1000, animDict = "amb@world_human_hammering@male@base", anim = "base", flag = 1 } } Config.LevelValues = { xpGainMultiplier = 10, levelUpXPMultiplier = 100, loseMultiplier = 0.5 } Config.MainRoutingBucket = 0 Config.Benches = {} Config.Blueprints = {} Config.CustomBlueprints = {} Config.Stations = {} ``` The empty tables above are only an outline. In your real file, `Config.Benches`, `Config.Blueprints`, and `Config.Stations` contain the actual bench types, blueprint recipes, fixed stations, recipes, targets, and access groups. ## Add bench items to inventory [#add-bench-items-to-inventory] Every key inside `Config.Benches.benchTypes` must also exist as an inventory item. The default config includes `weapon-crafting_bench` and `medical_bench`, so those item names need to be added before players can place those benches. If the bench type is `["weapon-crafting_bench"]`, the inventory item must also be `weapon-crafting_bench`. Bench item names cannot start with `weapon_` and must include `bench`. Add the bench item inside your inventory resource. For ESX servers using `ox_inventory`, this is usually `ox_inventory/data/items.lua`. ```lua title="resources/[standalone]/ox_inventory/data/items.lua" ["weapon-crafting_bench"] = { label = "Weapon Crafting Bench", weight = 1000, stack = false, close = true, description = "Places a weapon crafting bench." }, ["medical_bench"] = { label = "Medical Crafting Bench", weight = 1000, stack = false, close = true, description = "Places a medical crafting bench." }, ``` If your ESX server uses a different inventory, add the same item names using that inventory's item format. The important part is that the item name exactly matches the bench key in `Config.Benches.benchTypes`. Add the bench item in QBCore's shared item file, not inside the crafting resource. ```lua title="resources/[qb]/qb-core/shared/items.lua" ["weapon-crafting_bench"] = { name = "weapon-crafting_bench", label = "Weapon Crafting Bench", weight = 1000, type = "item", image = "weapon-crafting_bench.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Places a weapon crafting bench." }, ["medical_bench"] = { name = "medical_bench", label = "Medical Crafting Bench", weight = 1000, type = "item", image = "medical_bench.png", unique = true, useable = true, shouldClose = true, combinable = nil, description = "Places a medical crafting bench." }, ``` `unique = true` is recommended because benches can carry metadata, especially when `Config.Blueprints.store = "bench"`. Add the bench item inside your inventory resource. For most Qbox/QBX servers this is the inventory item file, for example `ox_inventory/data/items.lua`. ```lua title="resources/[standalone]/ox_inventory/data/items.lua" ["weapon-crafting_bench"] = { label = "Weapon Crafting Bench", weight = 1000, stack = false, close = true, description = "Places a weapon crafting bench." }, ["medical_bench"] = { label = "Medical Crafting Bench", weight = 1000, stack = false, close = true, description = "Places a medical crafting bench." }, ``` If you rename or add a bench type in `Config.Benches.benchTypes`, add the same item name here too. The crafting system registers each bench type as a usable item through `orbit-lib`. That means players use the inventory item, the resource previews the bench prop, and then the bench is placed if the player confirms the position. ## Where to add items [#where-to-add-items] Craftable items can live in three places. The recipe shape is mostly the same, but the location decides how the player accesses it. Put fixed-location recipes inside `Config.Stations[stationId].items`. ```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua" Config.Stations = { HideStationDistance = 50, ["weapon_station"] = { title = "Weapon Crafting Station", secondaryTitle = "Orbit Studios", blip = { haveBlip = true, sprite = 110, color = 1, scale = 0.8, coords = vector3(502.64, -1338.17, 29.31) }, target = { type = "npc", model = "s_m_m_ammucountry", coords = vector3(502.64, -1338.17, 29.31), heading = 37.18 }, groups = { jobs = {}, gangs = {} }, items = { ["weapon_pistol"] = { type = "weapon", itemLevel = 1, baseOdds = 50, maxOdds = 90, amountToCraft = 1, requirements = { { item = "plastic", amount = 5, removeOnSuccess = true, removeOnFail = true }, { item = "iron", amount = 5, removeOnSuccess = true, removeOnFail = false } } } } } } ``` Leave `groups.jobs` and `groups.gangs` empty for a public station. Add job or gang names only when the station should be restricted. Put bench recipes that do not need blueprints inside `Config.Benches.benchTypes[benchItemName].nonBlueprintItems`. ```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua" Config.Benches = { onlyOwnerCanMove = true, enableBenches = true, enablePersistentBenches = true, HideBenchDistance = 50, benchTypes = { ["weapon-crafting_bench"] = { benchProp = "prop_tool_bench02", benchLabel = "Weapon Bench", title = "Weapon Crafting Bench", secondaryTitle = "Orbit Studios", nonBlueprintItems = { ["weapon_knife"] = { type = "weapon", itemLevel = 1, baseOdds = 50, maxOdds = 90, amountToCraft = 1, requirements = { { item = "metalscrap", amount = 10, removeOnSuccess = true, removeOnFail = true }, { item = "steel", amount = 5, removeOnSuccess = true, removeOnFail = false } } } } } } } ``` The bench type key, such as `weapon-crafting_bench`, must match the bench inventory item name. Bench item names cannot start with `weapon_` and must include `bench`. Put blueprint-locked recipes inside `Config.Blueprints.items`. ```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua" Config.Blueprints = { store = "bench", items = { ["weapon_pistol"] = { bench = "weapon-crafting_bench", type = "weapon", itemLevel = 1, baseOdds = 60, maxOdds = 90, amountToCraft = 1, requirements = { { item = "metalscrap", amount = 10, removeOnSuccess = true, removeOnFail = true }, { item = "steel", amount = 5, removeOnSuccess = true, removeOnFail = false } } } } } ``` `store = "bench"` stores learned blueprints on the bench. `store = "player"` stores learned blueprints on the player. The `bench` value must match a key in `Config.Benches.benchTypes`. Use `Config.CustomBlueprints` when the physical inventory item has a different name from the recipe key. ```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua" Config.Blueprints = { store = "bench", items = { ["weapon_pistol"] = { bench = "weapon-crafting_bench", type = "weapon", itemLevel = 1, baseOdds = 60, maxOdds = 90, requirements = { { item = "metalscrap", amount = 10, removeOnSuccess = true, removeOnFail = true } } } } } Config.CustomBlueprints = { ["weapon_pistol"] = { customBlueprintName = "blueprint_weapon_pistol" } } ``` In this example, the blueprint content is still `weapon_pistol`, but the inventory item given to the player is `blueprint_weapon_pistol`. ## Recipe fields [#recipe-fields] Every recipe uses the same core fields whether it is placed in a station, bench, or blueprint list. ```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua" ["firstaid"] = { itemLevel = 2, baseOdds = 40, maxOdds = 90, amountToCraft = 2, requirements = { { item = "bandage", amount = 5, removeOnSuccess = true, removeOnFail = true }, { item = "painkillers", amount = 2, removeOnSuccess = true, removeOnFail = true } } } ``` Set `removeOnSuccess` and `removeOnFail` explicitly for each requirement while learning the config. That makes it obvious whether materials disappear on a successful craft, a failed craft, or both. ## Core shared options [#core-shared-options] ### Crafting wheel [#crafting-wheel] `Config.CraftingWithWheel` decides how strict the crafting level system is. ```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua" Config.CraftingWithWheel = true ``` When this is `true`, players use the success-percentage crafting wheel. `itemLevel`, `baseOdds`, and `maxOdds` decide how difficult the craft is and how much the chance can improve. When this is `false`, crafting becomes level-gated. Players can craft items at their level or below their level, and the percentage wheel is not used. ### NUI state callback [#nui-state-callback] `Config.NuiState` runs whenever the crafting UI opens or closes. Use it when another resource needs to know that the player is inside the crafting interface. ```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua" Config.NuiState = function(bool) if not Config.DeveloperMode then return end print("NUI Open:", bool) end ``` `bool = true` means the UI opened. `bool = false` means it closed. Set it to `nil` if you do not need this callback: ```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua" Config.NuiState = nil ``` ### Celebration animation [#celebration-animation] `Config.Celebration` is the animation played after a successful craft. ```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua" Config.Celebration = { animDict = "anim@mp_player_intcelebrationmale@air_guitar", animName = "air_guitar" } ``` To change the animation, replace both values with a valid GTA animation dictionary and animation name. To disable the celebration, set both values to `nil`. ```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua" Config.Celebration = { animDict = nil, animName = nil } ``` ### Bench animations [#bench-animations] `Config.BenchAnimations` is used by the `orbit-lib` progress integration when a player places or moves a bench. ```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua" Config.BenchAnimations = { putting_down_bench = { duration = 5000, animDict = "amb@world_human_hammering@male@base", anim = "base", flag = 1 }, moving_bench = { duration = 1000, animDict = "amb@world_human_hammering@male@base", anim = "base", flag = 1 } } ``` `duration` is in milliseconds. `animDict`, `anim`, and `flag` are passed to the progress animation. If you make the duration very short, bench placement will feel instant and players may not understand that the bench is being placed. ### Level values [#level-values] ```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua" Config.LevelValues = { xpGainMultiplier = 10, levelUpXPMultiplier = 100, loseMultiplier = 0.5 } ``` `loseMultiplier = 0.5` means a failed craft gives half of the XP the craft would normally give. ## Bench placement [#bench-placement] Bench placement controls where portable benches can be placed. Blacklist mode allows bench placement everywhere except inside listed zones. ```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua" Config.Benches.benchPlacement = { enabled = true, mode = "blacklist", zones = { { vectors = { vector3(494.22, -1328.00, 29.00), vector3(494.70, -1333.96, 29.00), vector3(500.11, -1335.09, 29.00) }, height = 10 } } } ``` Whitelist mode blocks bench placement everywhere except inside listed zones. ```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua" Config.Benches.benchPlacement = { enabled = true, mode = "whitelist", zones = { { vectors = { vector3(493.93, -1335.25, 29.00) }, radius = 5.0 } } } ``` Use `vectors` plus `height` for polygon zones. Use `vectors` plus `radius` for sphere zones. Use `vectors` plus `size = vec3(...)` for box zones. ```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua" { vectors = { vector3(493.93, -1335.25, 29.00) }, size = vec3(2, 2, 2) } ``` ## Station access [#station-access] Access groups live inside each station. Leave both tables empty for public use. ```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua" groups = { jobs = {}, gangs = {} } ``` Restrict by job or gang name with a minimum grade: ```lua title="resources/[orbit]/orbit-craftingsystem/shared/config.lua" groups = { jobs = { ["police"] = 0, ["ambulance"] = 2 }, gangs = { ["lostmc"] = 1 } } ``` `["ambulance"] = 2` means the player must have the ambulance job at grade 2 or higher. Job and gang names must match the data returned by your framework through `orbit-lib`. ## Server config [#server-config] `resources/[orbit]/orbit-craftingsystem/server/config.lua` is server-only. This is where inventory image URLs, Discord webhooks, and logging callbacks live. ## Inventory image URLs [#inventory-image-urls] Use `Config.Server.CustomImageURL` when item images are missing in the crafting UI. ```lua title="resources/[orbit]/orbit-craftingsystem/server/config.lua" Config.Server.CustomImageURL = false ``` For `ox_inventory`, this is a common value: ```lua title="resources/[orbit]/orbit-craftingsystem/server/config.lua" Config.Server.CustomImageURL = "cfx-nui-ox_inventory/web/images/" ``` The image file name should match the inventory item name. For example, `weapon_pistol` normally needs an image named like `weapon_pistol.png` in the configured image directory. ## Webhooks [#webhooks] Add your Discord webhook URL in `server/config.lua`. Do not put webhook URLs in `shared/config.lua`, because shared files can be loaded client-side. ```lua title="resources/[orbit]/orbit-craftingsystem/server/config.lua" Config.Server.Webhook = { url = "https://discord.com/api/webhooks/...", username = nil, avatar = nil } ``` Use `username` and `avatar` only if you want to override the Discord webhook defaults: ```lua title="resources/[orbit]/orbit-craftingsystem/server/config.lua" Config.Server.Webhook = { url = "https://discord.com/api/webhooks/...", username = "Orbit Crafting Logs", avatar = "https://example.com/logo.png" } ``` The included sender uses Discord embeds: ```lua title="resources/[orbit]/orbit-craftingsystem/server/config.lua" function Config.Server.SendWebhook(embed) local webhook = Config.Server.Webhook if not webhook.url or webhook.url == "" then return end PerformHttpRequest( webhook.url, function() end, "POST", json.encode({ username = webhook.username, avatar_url = webhook.avatar, embeds = { embed } }), { ["Content-Type"] = "application/json" } ) end ``` ## Crafting log webhook [#crafting-log-webhook] `Config.Server.OnCraft` runs after a valid crafting attempt. It receives the player, station or bench ID, item name, crafted amount, item level, and whether the craft succeeded. ```lua title="resources/[orbit]/orbit-craftingsystem/server/config.lua" Config.Server.Colors = { success = "#2ecc71", failed = "#e74c3c", suspicious = "#ff0000" } local function HexToDecimal(hex) return tonumber(hex:gsub("#", ""), 16) end Config.Server.OnCraft = function(source, stationId, itemName, craftedAmount, itemLevel, isWin) local playerName = GetPlayerName(source) or "Unknown" local playerId = source local embed = { title = isWin and "Crafting Successful" or "Crafting Failed", description = isWin and "The player successfully crafted an item." or "The crafting attempt failed.", color = HexToDecimal(isWin and Config.Server.Colors.success or Config.Server.Colors.failed), author = { name = playerName .. " (" .. playerId .. ")" }, fields = { { name = "Station or Bench", value = tostring(stationId), inline = false }, { name = "Item", value = tostring(itemName), inline = true }, { name = "Amount", value = tostring(craftedAmount), inline = true }, { name = "Item Level", value = tostring(itemLevel), inline = true } }, footer = { text = "Orbit Crafting System" }, timestamp = os.date("!%Y-%m-%dT%H:%M:%SZ") } Config.Server.SendWebhook(embed) end ``` Set `Config.Server.OnCraft = nil` if you want to disable normal crafting logs entirely: ```lua title="resources/[orbit]/orbit-craftingsystem/server/config.lua" Config.Server.OnCraft = nil ``` ## Suspicious activity webhook [#suspicious-activity-webhook] `Config.Server.SuspiciousActivity` runs when the server detects an invalid crafting attempt. This is useful for exploit attempts, invalid items, missing requirements, or other rejected craft requests. ```lua title="resources/[orbit]/orbit-craftingsystem/server/config.lua" Config.Server.SuspiciousActivity = function(source, stationId, itemName, craftedAmount, reason, isWin) local playerName = GetPlayerName(source) or "Unknown" local playerId = source local embed = { title = "Suspicious Crafting Activity", description = "Potential exploit or invalid crafting attempt detected.", color = HexToDecimal(Config.Server.Colors.suspicious), author = { name = playerName .. " (" .. playerId .. ")" }, fields = { { name = "Station or Bench", value = tostring(stationId), inline = false }, { name = "Item", value = tostring(itemName), inline = true }, { name = "Attempted Amount", value = tostring(craftedAmount), inline = true }, { name = "Reason", value = tostring(reason), inline = false } }, footer = { text = "Orbit Crafting System - monitor recommended" }, timestamp = os.date("!%Y-%m-%dT%H:%M:%SZ") } Config.Server.SendWebhook(embed) end ``` Set `Config.Server.SuspiciousActivity = nil` if you want to disable suspicious activity logs: ```lua title="resources/[orbit]/orbit-craftingsystem/server/config.lua" Config.Server.SuspiciousActivity = nil ``` ## Webhook testing [#webhook-testing] ### Add the webhook URL [#add-the-webhook-url] Paste the Discord webhook URL into `Config.Server.Webhook.url` in `server/config.lua`. ### Keep `OnCraft` enabled [#keep-oncraft-enabled] Make sure `Config.Server.OnCraft` is a function, not `nil`. ### Craft one test item [#craft-one-test-item] Join the server, open a station or bench, and craft an item. Discord should receive a success or failure embed. ### Check the server console [#check-the-server-console] If no message arrives, confirm the URL is not empty, outbound HTTP is allowed, and the config file is saved on the server. ## Apply and verify [#apply-and-verify] 1. Save both config files and validate their Lua syntax. 2. Restart Orbit Crafting System so shared recipes, target interactions, item data, and server hooks reload together. 3. Test one unrestricted station recipe before testing jobs, gangs, levels, blueprints, or placed benches. 4. Confirm every requirement and reward exists in the selected inventory and has a loadable image. 5. Test success and failure paths, including material removal, XP, celebration, progress, and NUI callbacks. 6. Place one bench and use one blueprint through the framework/inventory setup selected in Orbit Lib. 7. Send one craft and one suspicious-activity log before relying on the webhook in production. ## Common mistakes [#common-mistakes] Make sure the recipe is inside the correct table: `Config.Stations[stationId].items`, `Config.Benches.benchTypes[benchName].nonBlueprintItems`, or `Config.Blueprints.items`. Also confirm the player has access to the station or bench. Confirm the final item and every requirement item exists in your inventory or framework item list. Also check `removeOnSuccess` and `removeOnFail` so required materials are handled the way you expect. Put the URL in `Config.Server.Webhook.url`, keep `Config.Server.OnCraft` or `Config.Server.SuspiciousActivity` enabled, and make sure the webhook URL is valid. Webhook code belongs in `server/config.lua`, not `shared/config.lua`. Job and gang names must match the values returned by your framework through `orbit-lib`. Remove access groups temporarily to confirm the station itself works, then add restrictions back one at a time. # Dependencies (/docs/orbit-studios-resources/orbit-craftingsystem/dependencies) # Dependencies [#dependencies] Orbit Crafting System needs its database, library, inventory, target, framework bridge, and selected interface providers available before players begin crafting. ## Required [#required] | Dependency | Why it is needed | Link | | ------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | | `ox_lib` | Loads `@ox_lib/init.lua`, locales, callbacks, UI helpers, notifications, and target helper utilities used by the resource. | [overextended/ox\_lib](https://github.com/overextended/ox_lib) | | `oxmysql` | Loads `@oxmysql/lib/MySQL.lua` and stores persistent crafting data such as progression and bench data. | [overextended/oxmysql](https://github.com/overextended/oxmysql) | | `orbit-lib` | Provides the framework, inventory, target, notification, progress, player, item, and metadata bridge used by Orbit resources. | [orbit-lib](/docs/orbit-studios-resources/orbit-lib) | | Supported inventory | Required for checking materials, removing requirements, giving crafted items, blueprint metadata, and bench items. | [Supported inventories](/docs/orbit-studios-resources/orbit-lib/configuration#inventories) | | Supported target | Required for station and bench interactions. Use `ox_target` or `qb-target` through `orbit-lib`. | [ox\_target](https://github.com/overextended/ox_target), [qb-target](https://github.com/qbcore-framework/qb-target) | ## Supported inventories [#supported-inventories] The inventory is selected in `orbit-lib`, not inside the crafting resource. | `Config.Inventory` | Inventory | | ------------------ | --------------------------------------------------------------------------------- | | `ox_inventory` | [overextended/ox\_inventory](https://github.com/overextended/ox_inventory) | | `qb-inventory` | [qbcore-framework/qb-inventory](https://github.com/qbcore-framework/qb-inventory) | | `ps-inventory` | [Project-Sloth/ps-inventory](https://github.com/Project-Sloth/ps-inventory) | | `lj-inventory` | [loljoshie/lj-inventory](https://github.com/loljoshie/lj-inventory) | | `qb-like` | Custom QB-style inventory exports | | `ox-like` | Custom OX-style inventory exports | ## Optional integrations [#optional-integrations] | Integration | What it adds | Link | | --------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | | `orbit-dynamichud-v2` | Can provide notifications, progress bars, Text UI, and skill checks selected through Orbit Lib. | [Interface APIs](/docs/orbit-studios-resources/orbit-dynamichud-v2/interface) | | Discord webhook | Craft result and suspicious-activity logs configured only in `server/config.lua`. | [Webhooks](/docs/orbit-studios-resources/orbit-craftingsystem/configuration#webhooks) | ## Start order [#start-order] ```properties title="server.cfg" ensure oxmysql ensure ox_lib ensure [framework-resources] ensure [inventory] ensure [target] ensure orbit-lib ensure orbit-craftingsystem ``` If the crafting UI opens but materials or rewards fail, check the inventory provider in `orbit-lib` first. If stations or benches do not show, check the target provider and start order. ## Feature failure behavior [#feature-failure-behavior] * Missing `ox_lib` or `oxmysql` prevents required runtime, callback, locale, or persistence behavior. * A missing or mismatched inventory can leave materials unreadable, prevent removal, or block crafted rewards and bench items. * A missing or mismatched target prevents station and placed-bench interactions from appearing. * Incorrect Orbit Lib framework data breaks job, gang, player, and usable-item behavior even if the crafting UI loads. * A missing selected notification, progress, Text UI, or skill-check provider affects only the interface call until that provider is corrected. * An empty or invalid webhook URL disables external logging but should not be treated as a replacement for server-side validation. # Exports (/docs/orbit-studios-resources/orbit-craftingsystem/exports) # Exports [#exports] Use server exports from another server script and client exports from another client script. Calling a client export from server code, or a server export from client code, will not work. Call exports through the exact resource name `orbit-craftingsystem`. Renaming the folder breaks the examples and can invalidate dependencies or escrow expectations. ## Server examples [#server-examples] ```lua title="resources/[custom]/server/main.lua" local source = source local created = exports['orbit-craftingsystem']:CreateBlueprint(source, 'weapon_pistol', 1) if not created then print('[my-resource] Blueprint could not be created') end ``` ```lua title="resources/[custom]/server/main.lua" local level, xp = exports['orbit-craftingsystem']:getPlayerLevel(source) print(('Player level: %s, XP: %s'):format(level, xp)) ``` ```lua title="resources/[custom]/server/main.lua" local itemData = exports['orbit-craftingsystem']:getItemData(true, 'weapon_station', 'weapon_pistol', false) if itemData then print(('Base odds: %s'):format(itemData.baseOdds)) end ``` ## Client examples [#client-examples] ```lua title="resources/[custom]/client/main.lua" exports['orbit-craftingsystem']:previewProp('weapon-crafting_bench', 'prop_tool_bench02', nil, nil) ``` ```lua title="resources/[custom]/client/main.lua" exports['orbit-craftingsystem']:checkNearbyBenches('weapon_pistol', nil, nil) ``` The client helpers are mainly useful for advanced integrations. For normal setup, let the included bench item and blueprint item handlers call them automatically. ## Integration checklist [#integration-checklist] 1. Call the export from the correct client or server context. 2. Start Orbit Crafting System before the custom resource that calls it. 3. Validate player IDs, item names, blueprint names, metadata, and amounts before passing them. 4. Handle `false`, `nil`, or missing item data instead of assuming every call succeeds. 5. Keep normal bench and blueprint behavior on the included handlers unless the custom integration genuinely needs direct control. # Installation (/docs/orbit-studios-resources/orbit-craftingsystem) # Orbit Crafting System [#orbit-crafting-system] Orbit Crafting System is a configurable FiveM crafting resource for fixed stations, portable benches, blueprints, crafting levels, XP, access rules, and optional crafting minigame odds. For the official preview, showcase video, and store listing, start with the [Introduction](/docs/orbit-studios-resources/orbit-craftingsystem/introduction). Install and use this resource only when it was obtained for your account through the official Cfx.re Portal. Support requires both the matching Cfx.re Portal entitlement and the original Tebex purchase ID; a Portal entitlement by itself is not sufficient proof of purchase. Copies from Discord, leaked packs, file-sharing sites, source repositories, or another customer are unauthorized and unsupported. ## Installation [#installation] 1. Download the current release from the Cfx.re Portal account that owns the license. 2. Stop the server and extract the folder as `orbit-craftingsystem` without an extra nested directory. 3. Install `ox_lib`, `oxmysql`, the included Orbit Lib, a supported inventory, and a supported target resource. 4. Configure Orbit Lib for ESX, QB-Core, QBX, or standalone mode before configuring crafting. 5. Add every final item, material, bench item, and blueprint item to the selected inventory or framework item list. 6. Edit `shared/config.lua` for gameplay and `server/config.lua` for image paths, webhooks, and server hooks. 7. Start the resources in dependency order, then test one unrestricted station before adding all recipes. ```properties title="server.cfg" ensure oxmysql ensure ox_lib ensure [framework-resources] ensure [inventory] ensure [target] ensure orbit-lib ensure orbit-craftingsystem ``` ## Resource structure [#resource-structure] Use `shared/config.lua` for craftable items, benches, stations, blueprint requirements, levels, XP, animations, access rules, and NUI behavior. Use `server/config.lua` for inventory image URLs, Discord webhooks, and server-side crafting or suspicious-activity hooks. Runtime files are shown so you can verify that the release extracted correctly; edit only documented public files. ## Framework setup [#framework-setup] Configure ESX in Orbit Lib. Add normal and bench items to the inventory or ESX item store used by your server. Job access names and grades must match ESX data. Configure QB-Core in Orbit Lib. Add item definitions, including bench items, to `qb-core/shared/items.lua`, then add their images to the selected inventory. Job and gang names must match QBCore data. Configure QBX in Orbit Lib. Add items and bench items through the selected inventory, commonly `ox_inventory/data/items.lua`. Job and gang access uses normalized QBX data. Configure standalone player, job, gang, and usable-item adapters in Orbit Lib. Crafting can run without a framework, but every restricted feature depends on the normalized data those adapters return. ## First-run verification [#first-run-verification] 1. Confirm the database, library, framework, inventory, target, and Orbit Lib start without errors. 2. Open one station with job and gang restrictions temporarily removed. 3. Verify every displayed recipe has a clear label and non-missing inventory image. 4. Craft one successful and one failed attempt and confirm material removal follows the configured rules. 5. Place and reopen one bench item, then test one blueprint-gated recipe. 6. Verify crafting level and XP changes persist after reconnecting. 7. Test the configured notification, progress, NUI state, celebration, and bench animations. 8. Send one test craft log and confirm webhook URLs remain only in `server/config.lua`. ## Related Orbit resources [#related-orbit-resources] * [Orbit Lib](/docs/orbit-studios-resources/orbit-lib) is required for framework, inventory, target, notification, and progress bridges. * [Orbit Dynamic HUD 2.0](/docs/orbit-studios-resources/orbit-dynamichud-v2) can provide notifications, progress bars, Text UI, and skill checks selected through Orbit Lib. ## Support [#support] When requesting support, include the client/server console error, framework, inventory and target names, relevant config section, one affected recipe or bench, reproduction steps, the matching Cfx.re Portal entitlement, and the original Tebex purchase ID. Both purchase records are required. Never post the complete paid resource or webhook credentials publicly. # Introduction (/docs/orbit-studios-resources/orbit-craftingsystem/introduction) # Orbit Crafting System [#orbit-crafting-system] Orbit Crafting System lets a FiveM server offer fixed crafting stations and portable benches. You can configure recipes, required materials, blueprints, progression, access rules, and how workstations are placed and used. ## Video showcase [#video-showcase]