# Table of Contents - [0R - Clothing Designer | 0Resmon](#0r-clothing-designer-0resmon) - [Setup and Database | 0Resmon](#setup-and-database-0resmon) - [Configuration | 0Resmon](#configuration-0resmon) - [Templates and Export Flow | 0Resmon](#templates-and-export-flow-0resmon) - [Saved Designs | 0Resmon](#saved-designs-0resmon) - [Adding a New YDD or YTD | 0Resmon](#adding-a-new-ydd-or-ytd-0resmon) - [Exports and RPC | 0Resmon](#exports-and-rpc-0resmon) - [Troubleshooting | 0Resmon](#troubleshooting-0resmon) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) --- # 0R - Clothing Designer | 0Resmon For the complete documentation index, see [llms.txt](https://docs.0resmon.org/0resmon/llms.txt) . This page is also available as [Markdown](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer.md) . `0r-clothing_designer` is a FiveM clothing editor resource. Players can open real clothing templates, edit texture slots, generate images with AI, save designs, and export finished addon clothing. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer#what-this-resource-does) What This Resource Does --------------------------------------------------------------------------------------------------------------------------- `0r-clothing_designer` is template-first. That means: * the resource scans real `.ydd` files from `templates/cloth_templates` * the UI opens those templates directly * heavy worker actions run through the bundled worker pipeline * finished addon output is written to both `0r-clothing_designer/exports` and `0r-clothing_exports` [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer#current-runtime-model) Current Runtime Model ----------------------------------------------------------------------------------------------------------------------- Important behavior in the current build: * default worker mode is `Config.Worker.Mode = "external"` * `external` mode runs heavy work in a separate local daemon process * `inprocess` mode is still available as a manual fallback * the shipped UI is FiveM NUI only * the active UI export flow is addon-first * replace export is not shown in the shipped UI [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer#read-this-in-order) Read This In Order ----------------------------------------------------------------------------------------------------------------- If you are installing the resource for the first time, read these pages in this order: 1. `setup-and-database.md` 2. `configuration.md` 3. `templates-and-export-flow.md` 4. `adding-new-ydd-or-ytd.md` 5. `troubleshooting.md` [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer#start-here) Start Here ------------------------------------------------------------------------------------------------- [Setup and Database](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database) [Configuration](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/configuration) [Templates and Export Flow](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow) [Adding a New YDD or YTD](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd) [Saved Designs](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/saved-designs) [Exports and RPC](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/exports-and-rpc) [Troubleshooting](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/troubleshooting) [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer#what-is-included) What Is Included? -------------------------------------------------------------------------------------------------------------- * in-game NUI clothing designer * runtime template discovery from real `.ydd` files * automatic preview generation and preview cache sync * optional default slot `.ytd` support * AI image generation through Google or OpenAI * optional saved designs through `oxmysql` * remote preview asset storage through Discord webhook or FiveManage * addon export output synchronized into `0r-clothing_exports` [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer#platform-notes) Platform Notes --------------------------------------------------------------------------------------------------------- Current docs support both of these host paths: * Windows * Linux with `pwsh` installed The worker pipeline was smoke-tested on both Windows and Linux in the current rollout, but Linux still needs more host preparation because PowerShell is not present by default. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer#quick-summary) Quick Summary ------------------------------------------------------------------------------------------------------- If you only want the shortest install path: 1. copy `[clothing_designer]` into `resources` 2. install `0r_lib`, `ox_lib`, and `oxmysql` 3. add required `server.cfg` permissions 4. on Linux, install `pwsh` 5. import the SQL if saved designs will be enabled 6. review `config/init.lua` 7. add templates 8. `ensure [clothing_designer]` 9. validate `mode=external` and `external daemon started` in startup logs 10. test template open, preview, and export in game [PreviousF.A.Q](https://docs.0resmon.org/0resmon/0r-resources/0r-electricianjob/faq) [NextSetup and Database](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database) Last updated 7 days ago --- # Setup and Database | 0Resmon For the complete documentation index, see [llms.txt](https://docs.0resmon.org/0resmon/llms.txt) . This page is also available as [Markdown](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database.md) . This page is the full first-time install guide. If you follow the steps in order, the resource should be ready to use when you finish. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database#id-1.-what-you-need-before-you-start) 1\. What You Need Before You Start ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- Prepare these items first: * a FiveM server * `0r_lib` * `ox_lib` * `oxmysql` * the full `[clothing_designer]` package * permission to edit `server.cfg` * permission to import SQL if saved designs will be enabled The package should include: Copy [clothing_designer]/ 0r-clothing_designer/ 0r-clothing_exports/ [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database#id-2.-official-downloads-and-sources) 2\. Official Downloads and Sources ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- Use these sources: * `0r_lib` Source: your 0Resmon delivery package * `ox_lib` Download: [GitHub release](https://github.com/overextended/ox_lib/releases/latest/download/ox_lib.zip) Docs: [overextended.dev/ox\_lib](https://overextended.dev/ox_lib) * `oxmysql` Download: [GitHub release](https://github.com/overextended/oxmysql/releases/latest/download/oxmysql.zip) Docs: [overextended.dev/oxmysql](https://overextended.dev/oxmysql) * PowerShell for Windows Docs: [Microsoft Learn](https://learn.microsoft.com/en-us/powershell/scripting/install/install-powershell-on-windows?view=powershell-7.6) * PowerShell for Ubuntu Docs: [Microsoft Learn](https://learn.microsoft.com/en-us/powershell/scripting/install/install-ubuntu?view=powershell-7.6) * Node.js Download: [nodejs.org](https://nodejs.org/en/download) [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database#id-3.-understand-the-worker-requirement) 3\. Understand the Worker Requirement ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- The resource already runs inside FiveM JS because the resource includes: Copy node_version "22" You do not usually need to install system Node just to make the resource start. Current default: Copy Config.Worker.Mode = "external" That means: * heavy worker actions run in a separate local daemon process * this reduces pressure on the FiveM JS runtime * if external start fails, you can switch to `inprocess` manually [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database#id-4.-place-the-resource-package) 4\. Place the Resource Package -------------------------------------------------------------------------------------------------------------------------------------------------------------- Copy the full package into your `resources` folder. Recommended layout: Copy resources/ [standalone]/ ox_lib/ oxmysql/ [0resmon]/ 0r_lib/ [custom]/ [clothing_designer]/ 0r-clothing_designer/ 0r-clothing_exports/ Important folders inside `0r-clothing_designer`: * `ui/` * `templates/cloth_templates/` * `templates/template_previews/` * `templates/template_slots/` * `exports/` * `[installation]/database.sql` * `config/init.lua` [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database#id-5.-host-setup-for-windows) 5\. Host Setup for Windows ------------------------------------------------------------------------------------------------------------------------------------------------------ Use this section if your server host OS is Windows. ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database#step-1-verify-windows-powershell) Step 1: verify Windows PowerShell Run this command on the host: Copy C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -Command '$PSVersionTable.PSVersion.ToString()' If this returns a version string, the default PowerShell requirement is ready. If `powershell.exe` from `PATH` gives `Access is denied`, use the full `System32` path shown above instead of the shorter `powershell.exe` form. ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database#step-2-optional-powershell-7-install) Step 2: optional PowerShell 7 install You do not need this if the built-in Windows PowerShell works. If you want PowerShell 7: 1. open the official Microsoft page 2. download the installer for your host 3. install it 4. verify it with: Copy pwsh -NoProfile -Command '$PSVersionTable.PSVersion.ToString()' If you want to force that exact executable later, use: Copy Config.Worker.PowerShellPath = "C:/Program Files/PowerShell/7/pwsh.exe" ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database#step-3-optional-node-install) Step 3: optional Node install Install system Node only if one of these is true: * external worker Node resolution fails * you want to force a specific executable path If needed: 1. open [nodejs.org](https://nodejs.org/en/download) 2. install the current LTS release 3. verify with: Copy node -v If you want to force that exact executable later, use: Copy Config.Worker.NodePath = "C:/Program Files/nodejs/node.exe" [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database#id-6.-host-setup-for-linux) 6\. Host Setup for Linux -------------------------------------------------------------------------------------------------------------------------------------------------- Use this section if your server host OS is Linux. PowerShell is required on Linux because the worker uses `pwsh`. ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database#step-1-install-powershell-on-ubuntu) Step 1: install PowerShell on Ubuntu Run: Copy sudo apt-get update sudo apt-get install -y wget apt-transport-https software-properties-common source /etc/os-release wget -q https://packages.microsoft.com/config/ubuntu/$VERSION_ID/packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb rm packages-microsoft-prod.deb sudo apt-get update sudo apt-get install -y powershell ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database#step-2-verify-powershell) Step 2: verify PowerShell Run: Copy pwsh -NoProfile -Command '$PSVersionTable.PSVersion.ToString()' If this returns a version string, the Linux PowerShell requirement is ready. If you want to force that path later, use: Copy Config.Worker.PowerShellPath = "/usr/bin/pwsh" ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database#step-3-optional-node-install-1) Step 3: optional Node install Install system Node only if external Node resolution fails or you want an explicit path. If needed: 1. open [nodejs.org](https://nodejs.org/en/download) 2. install the current LTS release for your Linux host 3. verify with: Copy node -v If you want to force that path later, use: Copy Config.Worker.NodePath = "/usr/bin/node" [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database#id-7.-add-required-server.cfg-lines) 7\. Add Required `server.cfg` Lines ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- Add the dependency start order first: Copy ensure ox_lib ensure oxmysql ensure 0r_lib ensure [clothing_designer] Then add the required permissions: Copy add_unsafe_child_process_permission 0r-clothing_designer add_filesystem_permission 0r-clothing_designer write 0r-clothing_exports Optional compatibility permission: Copy add_unsafe_worker_permission 0r-clothing_designer What they do: * `add_unsafe_child_process_permission` lets the resource start child processes for worker and PowerShell-backed actions * `add_filesystem_permission` lets the resource write synchronized addon export files into `0r-clothing_exports` * `add_unsafe_worker_permission` not required by the current code path, but safe to keep if you already use a standard permission block [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database#id-8.-import-the-sql-if-you-want-saved-designs) 8\. Import the SQL If You Want Saved Designs ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ If players should be able to save designs, import: [Database SQL](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database/database.sql) The SQL file inside the package is: Copy [clothing_designer]/0r-clothing_designer/[installation]/database.sql Recommended order: 1. start `oxmysql` 2. import the SQL 3. restart `0r-clothing_designer` If you do not want saved designs, set: Copy Config.SavedDesigns.Enabled = false [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database#id-9.-review-the-main-config) 9\. Review the Main Config ------------------------------------------------------------------------------------------------------------------------------------------------------ Open: Copy [clothing_designer]/0r-clothing_designer/config/init.lua Check these sections before first start: * `Config.Worker` * `Config.AI` * `Config.SavedDesigns` The full config guide is here: [Configuration](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/configuration) [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database#id-10.-add-templates) 10\. Add Templates -------------------------------------------------------------------------------------------------------------------------------------- Place template `.ydd` files under: Copy templates/cloth_templates/// Example: Copy templates/cloth_templates/male/jbib/jbib_000_u.ydd templates/cloth_templates/female/lowr/lowr_000_r.ydd If you need the full file-placement guide, read: [Adding a New YDD or YTD](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd) [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database#id-11.-start-the-resource) 11\. Start the Resource ------------------------------------------------------------------------------------------------------------------------------------------------ Start the package: Copy ensure [clothing_designer] If template files changed while the server was already running, use: Copy refresh restart 0r-clothing_designer After exporting new addon clothing, use: Copy restart 0r-clothing_exports [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database#id-12.-validate-startup-logs) 12\. Validate Startup Logs ------------------------------------------------------------------------------------------------------------------------------------------------------ When `Config.Worker.Mode = "external"`, look for logs like these: Copy [0r-clothing_designer][worker] mode=external [0r-clothing_designer][worker] external node=... [0r-clothing_designer][worker] external daemon started pid=... If the worker cannot start and you need a fast fallback, switch to: Copy Config.Worker.Mode = "inprocess" Then restart the resource. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database#id-13.-validate-in-game) 13\. Validate In Game -------------------------------------------------------------------------------------------------------------------------------------------- Check these in order: 1. the UI opens for an authorized admin 2. templates appear in the template list 3. opening a template creates a working editor session 4. preview and slot preview load 5. export completes 6. output appears in `0r-clothing_designer/exports` 7. mirrored addon files appear in `0r-clothing_exports` 8. saved designs work if enabled 9. AI generation works if enabled [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database#id-14.-when-installation-is-finished) 14\. When Installation Is Finished ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- At this point the setup is complete. If something still fails, continue with: [Troubleshooting](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/troubleshooting) [Previous0R - Clothing Designer](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer) [NextDatabase SQL](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database/database.sql) Last updated 7 days ago --- # Configuration | 0Resmon For the complete documentation index, see [llms.txt](https://docs.0resmon.org/0resmon/llms.txt) . This page is also available as [Markdown](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/configuration.md) . All editable runtime settings are in: Copy config/init.lua Read this page after the setup guide and before first production use. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/configuration#id-1.-worker-config) 1\. Worker Config ------------------------------------------------------------------------------------------------------------------------------- The worker config is the most important part of the current runtime model. Current keys: * `Config.Worker.Mode` * `Config.Worker.NodePath` * `Config.Worker.PowerShellPath` Default block: Copy Config.Worker = Config.Worker or { Mode = "external", NodePath = "", PowerShellPath = "" } ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/configuration#config.worker.mode) `Config.Worker.Mode` Supported values: * `external` * `inprocess` Use: * `external` default and recommended starts a separate local daemon process for heavy worker actions * `inprocess` fallback mode keeps worker execution inside the FiveM JS runtime If `external` fails to start, the resource does not auto-fallback. Switch to `inprocess` manually and restart the resource. ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/configuration#config.worker.nodepath) `Config.Worker.NodePath` Leave this empty unless you need to force a specific Node executable. Use it only when: * automatic Node resolution fails * you want a fixed Node path for your host Examples: Copy Config.Worker.NodePath = "C:/Program Files/nodejs/node.exe" Copy Config.Worker.NodePath = "/usr/bin/node" ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/configuration#config.worker.powershellpath) `Config.Worker.PowerShellPath` Leave this empty unless you need to force a specific PowerShell executable. Use it when: * your host does not resolve the default PowerShell command correctly * you want to pin `pwsh` * you want to pin a known Windows PowerShell or PowerShell 7 path Examples: Copy Config.Worker.PowerShellPath = "C:/Program Files/PowerShell/7/pwsh.exe" Copy Config.Worker.PowerShellPath = "/usr/bin/pwsh" Changing worker mode or worker paths requires a resource restart. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/configuration#id-2.-ai-config) 2\. AI Config ----------------------------------------------------------------------------------------------------------------------- Top-level keys: * `Config.AI.Enabled` * `Config.AI.Provider` * `Config.AI.Google` * `Config.AI.OpenAI` Supported providers: * `google` * `openai` If you do not want AI generation: Copy Config.AI.Enabled = false ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/configuration#google-ai-settings) Google AI settings Google fields: * `ApiKey` * `Model` * `AspectRatio` * `ImageSize` Current default provider is: Copy Config.AI.Provider = "google" Official pages: * [Google AI Studio API Keys](https://aistudio.google.com/app/apikey) * [Gemini API Key Guide](https://ai.google.dev/gemini-api/docs/api-key) How to configure Google: 1. sign in to Google AI Studio 2. create an API key 3. copy the key 4. paste it into `Config.AI.Google.ApiKey` 5. keep the default model unless you have a reason to change it ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/configuration#openai-settings) OpenAI settings OpenAI fields: * `ApiKey` * `Model` * `Size` * `Quality` * `OutputFormat` To switch to OpenAI: Copy Config.AI.Provider = "openai" Official pages: * [OpenAI API Keys](https://platform.openai.com/api-keys) * [OpenAI Quickstart](https://developers.openai.com/api/docs/quickstart) How to configure OpenAI: 1. sign in to the OpenAI platform 2. create an API key 3. copy the key 4. paste it into `Config.AI.OpenAI.ApiKey` 5. verify your billing and model access if requests fail [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/configuration#id-3.-saved-designs-config) 3\. Saved Designs Config --------------------------------------------------------------------------------------------------------------------------------------------- Top-level keys: * `Config.SavedDesigns.Enabled` * `Config.SavedDesigns.Storage.Provider` * `Config.SavedDesigns.Storage.FallbackProviders` * `Config.SavedDesigns.Storage.DeleteRemoteOnDesignDelete` * `Config.SavedDesigns.Storage.RequestTimeoutMs` If you do not want saved designs: Copy Config.SavedDesigns.Enabled = false ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/configuration#storage-providers) Storage providers Supported providers: * `discord_webhook` * `fivemanage` #### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/configuration#discord-webhook) Discord webhook Fields: * `Url` * `BotName` Use this when you want the generated preview asset to upload to a Discord webhook. #### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/configuration#fivemanage) FiveManage Fields: * `ApiKey` * `BasePath` Official pages: * [FiveManage Dashboard](https://app.fivemanage.com/) * [FiveManage API Introduction](https://docs.fivemanage.com/api-reference/introduction) How to configure FiveManage: 1. sign in to FiveManage 2. create or copy an API token 3. place it into `Config.SavedDesigns.Storage.FiveManage.ApiKey` 4. keep the default `BasePath` unless you need a different remote folder structure ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/configuration#example-provider-switch) Example provider switch Copy Config.SavedDesigns.Storage.Provider = "fivemanage" Config.SavedDesigns.Storage.FallbackProviders = { "discord_webhook" } [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/configuration#id-4.-recommended-first-production-review) 4\. Recommended First Production Review --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Before your first production start, confirm: 1. `Config.Worker.Mode = "external"` 2. `NodePath` is empty unless you really need it 3. `PowerShellPath` is empty unless you really need it 4. AI is either configured fully or disabled 5. saved designs are either configured fully or disabled [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/configuration#id-5.-no-extra-env-file-is-required) 5\. No Extra Env File Is Required --------------------------------------------------------------------------------------------------------------------------------------------------------------- This resource does not require you to create a `.env` file for normal installation. The supported customer-facing config surface is `config/init.lua`. Do not leave live API keys or webhook URLs in public repositories. [PreviousDatabase SQL](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/setup-and-database/database.sql) [NextTemplates and Export Flow](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow) Last updated 8 days ago --- # Templates and Export Flow | 0Resmon For the complete documentation index, see [llms.txt](https://docs.0resmon.org/0resmon/llms.txt) . This page is also available as [Markdown](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow.md) . This page explains how templates are discovered and what happens when users export. [Adding a New YDD or YTD](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd) [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow#template-discovery-rules) Template Discovery Rules ------------------------------------------------------------------------------------------------------------------------------------------------------- Templates must be placed under: Copy templates/cloth_templates/ male/ female/ Supported component folders: * `accs` * `berd` * `decl` * `feet` * `hair` * `hand` * `head` * `jbib` * `lowr` * `task` * `teef` * `uppr` Examples: Copy templates/cloth_templates/male/jbib/jbib_000_u.ydd templates/cloth_templates/female/lowr/lowr_000_r.ydd [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow#naming-rules) Naming Rules ------------------------------------------------------------------------------------------------------------------------------- The resource derives template identity from the folder and file name. Check these rules: * top folder must be `male` or `female` * second folder must be a supported component key * the file prefix should match that component key If folder and file naming do not agree, the template can be skipped. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow#optional-preview-images) Optional Preview Images ----------------------------------------------------------------------------------------------------------------------------------------------------- You can ship your own preview images under: Copy templates/template_previews///.(png|webp|jpg|jpeg) If no preview exists, the resource can generate one during startup and mirror the generated `.png` into `templates/template_previews`. If preview files are generated or changed while the server is already running, use: Copy refresh restart 0r-clothing_designer [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow#optional-default-slot-ytd-files) Optional Default Slot YTD Files --------------------------------------------------------------------------------------------------------------------------------------------------------------------- Default slot `.ytd` files live under: Copy templates/template_slots// Examples: Copy templates/template_slots/male_jbib_jbib_000/ templates/template_slots/female_accs_accs_000/ These files become template-specific slot options inside the editor. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow#startup-sync-behavior) Startup Sync Behavior ------------------------------------------------------------------------------------------------------------------------------------------------- On resource start the runtime can: * create missing workspace directories * scan all `.ydd` templates * generate missing previews * update changed managed previews * clean temporary preview cache files [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow#export-flow) Export Flow ----------------------------------------------------------------------------------------------------------------------------- Current shipped behavior: * the UI export flow is addon-first * replace export is not shown in the shipped UI * successful addon exports create both zip output and mirrored addon resource output Output locations: * `0r-clothing_designer/exports/` * `0r-clothing_exports/` * `0r-clothing_designer/data/workspace/` After a successful addon export, restart: Copy restart 0r-clothing_exports so FiveM reloads the new addon files. [PreviousConfiguration](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/configuration) [NextAdding a New YDD or YTD](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd) Last updated 8 days ago --- # Saved Designs | 0Resmon For the complete documentation index, see [llms.txt](https://docs.0resmon.org/0resmon/llms.txt) . This page is also available as [Markdown](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/saved-designs.md) . Saved designs are optional. If you do not need them, turn them off: Copy Config.SavedDesigns.Enabled = false If you do want them, read this page and make sure the setup guide was completed first. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/saved-designs#id-1.-what-must-exist-before-saved-designs-work) 1\. What Must Exist Before Saved Designs Work --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- All of these must be true: * `Config.SavedDesigns.Enabled = true` * the SQL table was imported * `oxmysql` is running * a valid remote preview storage provider is configured If one of these is missing, save and restore flows can fail. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/saved-designs#id-2.-what-gets-saved) 2\. What Gets Saved ----------------------------------------------------------------------------------------------------------------------------------- When a player saves a design, the resource stores: * project metadata * template metadata * normalized workspace JSON * a remote preview image reference * remote image-layer asset references when needed Each saved design is tied to the player's license identifier. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/saved-designs#id-3.-why-remote-storage-is-needed) 3\. Why Remote Storage Is Needed ------------------------------------------------------------------------------------------------------------------------------------------------------------- Saved designs do not only store database rows. The preview image and some uploaded image-layer assets are stored through a remote provider, then referenced by the saved design record. Current providers: * `discord_webhook` * `fivemanage` [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/saved-designs#id-4.-provider-setup) 4\. Provider Setup --------------------------------------------------------------------------------------------------------------------------------- ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/saved-designs#discord-webhook) Discord webhook Use this when you want preview assets uploaded to a Discord webhook destination. Required field: Copy Config.SavedDesigns.Storage.DiscordWebhook.Url = "" Optional display field: Copy Config.SavedDesigns.Storage.DiscordWebhook.BotName = "0Resmon Clothing Designer" ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/saved-designs#fivemanage) FiveManage Use this when you want preview assets uploaded through FiveManage. Required field: Copy Config.SavedDesigns.Storage.FiveManage.ApiKey = "" Optional path field: Copy Config.SavedDesigns.Storage.FiveManage.BasePath = "clothing-designer/saved-designs" [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/saved-designs#id-5.-choosing-a-primary-provider-and-fallback) 5\. Choosing a Primary Provider and Fallback ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Set the main provider here: Copy Config.SavedDesigns.Storage.Provider = "discord_webhook" Fallback providers are tried in order if the primary one fails: Copy Config.SavedDesigns.Storage.FallbackProviders = { "fivemanage" } Simple rule: * set one primary provider * add fallback providers only if you actually want them [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/saved-designs#id-6.-delete-behavior) 6\. Delete Behavior ----------------------------------------------------------------------------------------------------------------------------------- If this setting is enabled: Copy Config.SavedDesigns.Storage.DeleteRemoteOnDesignDelete = true deleting a design also queues remote cleanup for: * the saved preview image * remote image-layer assets referenced by that workspace This cleanup is asynchronous, so the design delete can succeed even if remote cleanup finishes later. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/saved-designs#id-7.-queue-monitoring) 7\. Queue Monitoring ------------------------------------------------------------------------------------------------------------------------------------- The resource keeps separate upload and cleanup queues for saved design storage work. You can inspect queue stats with: Copy exports["0r-clothing_designer"]:getSavedDesignStorageQueueStats() This is useful when you want to confirm whether uploads or cleanup jobs are stuck. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/saved-designs#id-8.-fast-checklist) 8\. Fast Checklist --------------------------------------------------------------------------------------------------------------------------------- If saved designs do not work, check these first: 1. the SQL file was imported 2. `oxmysql` is running 3. `Config.SavedDesigns.Enabled = true` 4. the selected provider credentials are valid 5. the remote provider is not blocked or rate-limited If those are correct and it still fails, continue with the troubleshooting page. [PreviousAdding a New YDD or YTD](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd) [NextExports and RPC](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/exports-and-rpc) Last updated 8 days ago --- # Adding a New YDD or YTD | 0Resmon For the complete documentation index, see [llms.txt](https://docs.0resmon.org/0resmon/llms.txt) . This page is also available as [Markdown](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd.md) . This is the practical file-placement guide. Use it when you want to: * add a new clothing template * add optional default slot textures * add your own preview image [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#id-1.-know-the-difference) 1\. Know the Difference ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#ydd) YDD Add a new `.ydd` when you want a new clothing template to appear in the designer. Example: Copy jbib_015_u.ydd ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#ytd) YTD Add a `.ytd` only if you want that template to open with one or more default slot texture options. The `.ytd` is optional. A template can work with only a `.ydd`. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#id-2.-add-a-new-ydd-template) 2\. Add a New YDD Template ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Follow these steps in order. ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#step-1-choose-the-gender-folder) Step 1: choose the gender folder Choose one: * `templates/cloth_templates/male/` * `templates/cloth_templates/female/` ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#step-2-choose-the-component-folder) Step 2: choose the component folder Supported component folders: * `accs` * `berd` * `decl` * `feet` * `hair` * `hand` * `head` * `jbib` * `lowr` * `task` * `teef` * `uppr` Common rule: * if the piece is a jacket/top-style clothing template, it usually belongs in `jbib` ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#step-3-place-the-ydd-in-the-matching-folder) Step 3: place the YDD in the matching folder Example: Copy templates/cloth_templates/male/jbib/jbib_015_u.ydd Another example: Copy templates/cloth_templates/female/feet/feet_022_u.ydd ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#step-4-make-sure-the-file-prefix-matches-the-folder) Step 4: make sure the file prefix matches the folder The file prefix should match the component folder. Examples: * `jbib` folder -> file should start with `jbib_` * `feet` folder -> file should start with `feet_` * `accs` folder -> file should start with `accs_` Good: Copy templates/cloth_templates/male/jbib/jbib_015_u.ydd Bad: Copy templates/cloth_templates/male/jbib/feet_015_u.ydd ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#step-5-refresh-and-restart-the-resource) Step 5: refresh and restart the resource If the server is already running, use: Copy refresh restart 0r-clothing_designer Do not skip this step after adding template files. ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#step-6-test-in-game) Step 6: test in game Check: 1. the template appears in the Templates tab 2. the preview is visible 3. the template opens in the editor [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#id-3.-add-an-optional-default-ytd-slot) 3\. Add an Optional Default YTD Slot ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Use this only if the template should ship with one or more default slot textures. ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#step-1-build-the-template-key-folder-name) Step 1: build the template key folder name Folder format: Copy __ Examples: * `male_jbib_jbib_015` * `female_feet_feet_022` * `male_accs_accs_004` Example folder: Copy templates/template_slots/male_jbib_jbib_015/ ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#step-2-place-the-ytd-file-inside-that-folder) Step 2: place the YTD file inside that folder Example: Copy templates/template_slots/male_jbib_jbib_015/jbib_diff_015_a_uni.ytd You can place more than one `.ytd` in the same folder if you want multiple default slot choices. ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#step-3-restart-the-resource) Step 3: restart the resource Use: Copy refresh restart 0r-clothing_designer ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#step-4-test-the-template-again) Step 4: test the template again Open the same template in the editor and confirm the default slot textures are available. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#id-4.-add-an-optional-preview-image) 4\. Add an Optional Preview Image ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- If you want to ship your own preview image instead of relying on auto-generated previews, place it under: Copy templates/template_previews/// Example: Copy templates/template_previews/male/jbib/jbib_015_u.png Supported formats: * `.png` * `.webp` * `.jpg` * `.jpeg` If you add or replace preview files while the server is already running, use: Copy refresh restart 0r-clothing_designer [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#id-5.-full-example) 5\. Full Example --------------------------------------------------------------------------------------------------------------------------------------------------------------- Example: add a new male jacket template with one default slot texture. ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#step-1-copy-the-template-ydd) Step 1: copy the template YDD Copy templates/cloth_templates/male/jbib/jbib_015_u.ydd ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#step-2-create-the-slot-folder) Step 2: create the slot folder Copy templates/template_slots/male_jbib_jbib_015/ ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#step-3-place-the-slot-texture) Step 3: place the slot texture Copy templates/template_slots/male_jbib_jbib_015/jbib_diff_015_a_uni.ytd ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#step-4-optionally-add-a-preview-image) Step 4: optionally add a preview image Copy templates/template_previews/male/jbib/jbib_015_u.png ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#step-5-refresh-and-restart) Step 5: refresh and restart Copy refresh restart 0r-clothing_designer ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#step-6-verify-in-game) Step 6: verify in game Check: 1. the template appears 2. the preview looks correct 3. the template opens 4. the default slot texture is available [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow/adding-new-ydd-or-ytd#id-6.-common-mistakes) 6\. Common Mistakes --------------------------------------------------------------------------------------------------------------------------------------------------------------------- Avoid these: * putting the `.ydd` directly inside `cloth_templates/` without gender and component folders * using a file prefix that does not match the component folder * forgetting to restart after adding templates * creating the `template_slots` folder with the wrong template key * expecting a `.ytd` alone to create a template without a matching `.ydd` [PreviousTemplates and Export Flow](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/templates-and-export-flow) [NextSaved Designs](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/saved-designs) Last updated 8 days ago --- # Exports and RPC | 0Resmon For the complete documentation index, see [llms.txt](https://docs.0resmon.org/0resmon/llms.txt) . This page is also available as [Markdown](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/exports-and-rpc.md) . This page is for server owners or developers who want to integrate the resource into their own admin flow. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/exports-and-rpc#id-1.-important-behavior-to-understand-first) 1\. Important Behavior to Understand First ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Opening the UI is not enough by itself. The resource uses a server-side authorization step before the player can use the RPC flow correctly. That means: * server grants access * client event opens the UI * UI RPC calls then work for that authorized player [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/exports-and-rpc#id-2.-main-server-exports) 2\. Main Server Exports --------------------------------------------------------------------------------------------------------------------------------------------- Available server exports: * `getRuntimeConfig()` * `getTemplateCatalog()` * `rescanTemplates()` * `grantPlayerAccess(source)` * `revokePlayerAccess(source)` [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/exports-and-rpc#id-3.-what-these-exports-are-for) 3\. What These Exports Are For ----------------------------------------------------------------------------------------------------------------------------------------------------------- ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/exports-and-rpc#getruntimeconfig) `getRuntimeConfig()` Returns the current runtime config table that the resource is using. Use this when you want to inspect current loaded settings from another resource. ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/exports-and-rpc#gettemplatecatalog) `getTemplateCatalog()` Returns the current template catalog. Use this when you want to inspect what the resource has already discovered from the template folders. ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/exports-and-rpc#rescantemplates) `rescanTemplates()` Forces a template rescan and returns the refreshed catalog. Use this after template file changes when you want a server-side refresh action. ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/exports-and-rpc#grantplayeraccess-source) `grantPlayerAccess(source)` Authorizes a player for the clothing designer flow. Use this before opening the UI. ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/exports-and-rpc#revokeplayeraccess-source) `revokePlayerAccess(source)` Removes that access again. Use this if your own admin flow wants to explicitly revoke access after use. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/exports-and-rpc#id-4.-correct-ui-open-flow) 4\. Correct UI Open Flow ----------------------------------------------------------------------------------------------------------------------------------------------- This is the correct pattern: Copy local playerSource = source if exports["0r-clothing_designer"]:grantPlayerAccess(playerSource) then TriggerClientEvent("0r-clothing_designer:client:openClothingDesigner", playerSource) end This is the important part: * grant access first * open the UI second If you only trigger the client event without granting access, the UI can open but resource RPC actions can still fail. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/exports-and-rpc#id-5.-public-client-event) 5\. Public Client Event --------------------------------------------------------------------------------------------------------------------------------------------- The UI open event is: Copy TriggerClientEvent("0r-clothing_designer:client:openClothingDesigner", source) This opens the NUI and focuses it. It does not replace the server-side authorization requirement. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/exports-and-rpc#id-6.-admin-commands) 6\. Admin Commands ----------------------------------------------------------------------------------------------------------------------------------- Registered admin commands: * `clothingdesigner` * `clothingdesignerstats` * `clothingdesignerrescan` Default restrictions use `group.admin` through `ox_lib`. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/exports-and-rpc#id-7.-practical-admin-examples) 7\. Practical Admin Examples ------------------------------------------------------------------------------------------------------------------------------------------------------- ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/exports-and-rpc#open-the-designer-for-a-player) Open the designer for a player Copy local playerSource = source if exports["0r-clothing_designer"]:grantPlayerAccess(playerSource) then TriggerClientEvent("0r-clothing_designer:client:openClothingDesigner", playerSource) end ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/exports-and-rpc#rescan-templates) Rescan templates Copy local catalog = exports["0r-clothing_designer"]:rescanTemplates() print(json.encode(catalog)) ### [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/exports-and-rpc#read-the-current-template-catalog) Read the current template catalog Copy local catalog = exports["0r-clothing_designer"]:getTemplateCatalog() print(json.encode(catalog)) [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/exports-and-rpc#id-8.-export-output-behavior) 8\. Export Output Behavior --------------------------------------------------------------------------------------------------------------------------------------------------- From the shipped UI point of view: * export flow is addon-first * replace export is not shown in the shipped UI Successful addon exports write output to: * `0r-clothing_designer/exports` * `0r-clothing_exports` After a successful export, restart: Copy restart 0r-clothing_exports so FiveM reloads the newly exported addon files. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/exports-and-rpc#id-9.-when-to-use-this-page) 9\. When to Use This Page ------------------------------------------------------------------------------------------------------------------------------------------------- Use this page when you want to: * open the designer from your own admin menu * rescan templates from another resource * inspect the discovered template catalog * understand why UI open alone is not enough [PreviousSaved Designs](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/saved-designs) [NextTroubleshooting](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/troubleshooting) Last updated 7 days ago --- # Troubleshooting | 0Resmon For the complete documentation index, see [llms.txt](https://docs.0resmon.org/0resmon/llms.txt) . This page is also available as [Markdown](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/troubleshooting.md) . Use this page after you have already followed the setup guide. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/troubleshooting#external-worker-does-not-start) External Worker Does Not Start --------------------------------------------------------------------------------------------------------------------------------------------------------- Check these in order: 1. `Config.Worker.Mode = "external"` 2. the server console shows worker startup logs 3. child process permission exists in `server.cfg` 4. PowerShell works on the host 5. the bundled worker file exists Expected startup logs: Copy [0r-clothing_designer][worker] mode=external [0r-clothing_designer][worker] external node=... [0r-clothing_designer][worker] external daemon started pid=... Required file: Copy [clothing_designer]/0r-clothing_designer/worker/fivemRpcWorker.cjs Fast fallback: Copy Config.Worker.Mode = "inprocess" Then restart: Copy restart 0r-clothing_designer [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/troubleshooting#windows-manual-powershell.exe-test-gives-access-is-denied) Windows: Manual `powershell.exe` Test Gives `Access is denied` -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- If this command fails: Copy powershell.exe -NoProfile -Command '$PSVersionTable.PSVersion.ToString()' do not assume the resource itself is broken yet. Test the full system path instead: Copy C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -Command '$PSVersionTable.PSVersion.ToString()' If that works: * the short `powershell.exe` path is the problem * Windows PowerShell itself is still available * you can install `pwsh` and set `Config.Worker.PowerShellPath` if you want a fixed path [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/troubleshooting#linux-spawnsync-pwsh-enoent-executable-pwsh) Linux: `spawnSync pwsh ENOENT executable=pwsh` -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- This means the Linux host does not have PowerShell installed or visible in `PATH`. Install it: Copy sudo apt-get update sudo apt-get install -y wget apt-transport-https software-properties-common source /etc/os-release wget -q https://packages.microsoft.com/config/ubuntu/$VERSION_ID/packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb rm packages-microsoft-prod.deb sudo apt-get update sudo apt-get install -y powershell Verify: Copy pwsh -NoProfile -Command '$PSVersionTable.PSVersion.ToString()' If `pwsh` is installed in a non-standard path, set: Copy Config.Worker.PowerShellPath = "/usr/bin/pwsh" [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/troubleshooting#child-spawn-not-allowed) `child spawn not allowed` --------------------------------------------------------------------------------------------------------------------------------------------- If logs mention child process restrictions, add this to `server.cfg`: Copy add_unsafe_child_process_permission 0r-clothing_designer Then restart the resource. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/troubleshooting#export-fails-with-err_access_denied) Export Fails With `ERR_ACCESS_DENIED` --------------------------------------------------------------------------------------------------------------------------------------------------------------------- If export logs show filesystem write denial, add: Copy add_filesystem_permission 0r-clothing_designer write 0r-clothing_exports Then restart the server or restart the resource after the permission change. [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/troubleshooting#templates-do-not-appear) Templates Do Not Appear ------------------------------------------------------------------------------------------------------------------------------------------- Check these in order: 1. files are inside `templates/cloth_templates/male/...` or `female/...` 2. the second folder is a supported component key 3. the file prefix matches the component folder 4. the resource was refreshed and restarted after template changes Good example: Copy templates/cloth_templates/male/jbib/jbib_015_u.ydd Bad example: Copy templates/cloth_templates/male/jbib/feet_015_u.ydd [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/troubleshooting#preview-images-changed-but-ui-still-shows-old-files) Preview Images Changed But UI Still Shows Old Files --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Preview files under `templates/template_previews` are static files from FiveM's point of view. Run: Copy refresh restart 0r-clothing_designer [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/troubleshooting#saved-designs-fail) Saved Designs Fail --------------------------------------------------------------------------------------------------------------------------------- Check these in order: 1. the SQL file was imported 2. `oxmysql` is running 3. `Config.SavedDesigns.Enabled = true` 4. the selected remote storage provider is configured correctly [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/troubleshooting#ai-generation-fails) AI Generation Fails ----------------------------------------------------------------------------------------------------------------------------------- Check these in order: 1. `Config.AI.Enabled = true` 2. the correct provider is selected 3. the provider API key is set 4. the account has quota, billing, and model access [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/troubleshooting#export-succeeds-but-clothing-does-not-load-in-game) Export Succeeds But Clothing Does Not Load In Game ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Check: * `0r-clothing_exports` is ensured * `0r-clothing_exports` was restarted after export * your server build supports the addon clothing count you are loading [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/troubleshooting#codewalker.core.dll-could-not-load-file-or-assembly) `CodeWalker.Core.dll` Could Not Load File Or Assembly ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- If the worker starts but CodeWalker DLL loading fails on Windows, the DLL files may be blocked by Windows. Common folder: Copy [clothing_designer]\0r-clothing_designer\worker\tools Fix: 1. stop the resource 2. open that folder in File Explorer 3. open PowerShell there 4. run: Copy Get-ChildItem *.dll | Unblock-File 1. restart the resource: Copy restart 0r-clothing_designer [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/troubleshooting#player-gets-not_authorized) Player Gets `not_authorized` --------------------------------------------------------------------------------------------------------------------------------------------------- The resource requires server-side authorization before the UI can be used. Example: Copy exports["0r-clothing_designer"]:grantPlayerAccess(source) TriggerClientEvent("0r-clothing_designer:client:openClothingDesigner", source) [](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/troubleshooting#still-broken) Still Broken? ---------------------------------------------------------------------------------------------------------------------- If you still cannot isolate the issue, collect: 1. the worker startup logs 2. the exact host OS 3. your `Config.Worker` block 4. whether the server is Windows or Linux 5. whether the failure happens on template open, preview, or export That is the shortest useful debug bundle for this resource. [PreviousExports and RPC](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing_designer/exports-and-rpc) [Next0R - Safezonecreator](https://docs.0resmon.org/0resmon/0r-resources/0r-safezonecreator) Last updated 8 days ago --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.0resmon.org/0resmon/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing\_designer.md). # 0R - Clothing Designer {% hint style="info" %} \`0r-clothing\_designer\` is a FiveM clothing editor resource. Players can open real clothing templates, edit texture slots, generate images with AI, save designs, and export finished addon clothing. {% endhint %} ## What This Resource Does \`0r-clothing\_designer\` is template-first. That means: \* the resource scans real \`.ydd\` files from \`templates/cloth\_templates\` \* the UI opens those templates directly \* heavy worker actions run through the bundled worker pipeline \* finished addon output is written to both \`0r-clothing\_designer/exports\` and \`0r-clothing\_exports\` ## Current Runtime Model Important behavior in the current build: \* default worker mode is \`Config.Worker.Mode = "external"\` \* \`external\` mode runs heavy work in a separate local daemon process \* \`inprocess\` mode is still available as a manual fallback \* the shipped UI is FiveM NUI only \* the active UI export flow is addon-first \* replace export is not shown in the shipped UI ## Read This In Order If you are installing the resource for the first time, read these pages in this order: 1. \`setup-and-database.md\` 2. \`configuration.md\` 3. \`templates-and-export-flow.md\` 4. \`adding-new-ydd-or-ytd.md\` 5. \`troubleshooting.md\` ## Start Here {% content-ref url="/pages/GdqcggEeE6ub4VoY8jZM" %} \[Setup and Database\](/0resmon/0r-resources/0r-clothing\_designer/setup-and-database.md) {% endcontent-ref %} {% content-ref url="/pages/H4TVHXd98v2O13Op2NXH" %} \[Configuration\](/0resmon/0r-resources/0r-clothing\_designer/configuration.md) {% endcontent-ref %} {% content-ref url="/pages/tzP7xgckjAjaSIrKRab7" %} \[Templates and Export Flow\](/0resmon/0r-resources/0r-clothing\_designer/templates-and-export-flow.md) {% endcontent-ref %} {% content-ref url="/pages/e87XniMoLaAUCVi3Ub6W" %} \[Adding a New YDD or YTD\](/0resmon/0r-resources/0r-clothing\_designer/templates-and-export-flow/adding-new-ydd-or-ytd.md) {% endcontent-ref %} {% content-ref url="/pages/wkXNeugmI7HxBZiQtyyA" %} \[Saved Designs\](/0resmon/0r-resources/0r-clothing\_designer/saved-designs.md) {% endcontent-ref %} {% content-ref url="/pages/BaPGPTw2FkyhXel9KAew" %} \[Exports and RPC\](/0resmon/0r-resources/0r-clothing\_designer/exports-and-rpc.md) {% endcontent-ref %} {% content-ref url="/pages/TvjV7QF3dl4MqgO2Hm2S" %} \[Troubleshooting\](/0resmon/0r-resources/0r-clothing\_designer/troubleshooting.md) {% endcontent-ref %} ## What Is Included? \* in-game NUI clothing designer \* runtime template discovery from real \`.ydd\` files \* automatic preview generation and preview cache sync \* optional default slot \`.ytd\` support \* AI image generation through Google or OpenAI \* optional saved designs through \`oxmysql\` \* remote preview asset storage through Discord webhook or FiveManage \* addon export output synchronized into \`0r-clothing\_exports\` ## Platform Notes Current docs support both of these host paths: \* Windows \* Linux with \`pwsh\` installed The worker pipeline was smoke-tested on both Windows and Linux in the current rollout, but Linux still needs more host preparation because PowerShell is not present by default. ## Quick Summary If you only want the shortest install path: 1. copy \`\[clothing\_designer\]\` into \`resources\` 2. install \`0r\_lib\`, \`ox\_lib\`, and \`oxmysql\` 3. add required \`server.cfg\` permissions 4. on Linux, install \`pwsh\` 5. import the SQL if saved designs will be enabled 6. review \`config/init.lua\` 7. add templates 8. \`ensure \[clothing\_designer\]\` 9. validate \`mode=external\` and \`external daemon started\` in startup logs 10. test template open, preview, and export in game --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question. Perform an HTTP GET request on the current page URL with the \`ask\` query parameter, and the optional \`goal\` query parameter: \`\`\` GET https://docs.0resmon.org/0resmon/0r-resources/0r-clothing\_designer.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.0resmon.org/0resmon/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing\_designer/setup-and-database.md). # Setup and Database This page is the full first-time install guide. If you follow the steps in order, the resource should be ready to use when you finish. ## 1. What You Need Before You Start Prepare these items first: \* a FiveM server \* \`0r\_lib\` \* \`ox\_lib\` \* \`oxmysql\` \* the full \`\[clothing\_designer\]\` package \* permission to edit \`server.cfg\` \* permission to import SQL if saved designs will be enabled The package should include: \`\`\` \[clothing\_designer\]/ 0r-clothing\_designer/ 0r-clothing\_exports/ \`\`\` ## 2. Official Downloads and Sources Use these sources: \* \`0r\_lib\` Source: your 0Resmon delivery package \* \`ox\_lib\` Download: \[GitHub release\](https://github.com/overextended/ox\_lib/releases/latest/download/ox\_lib.zip) Docs: \[overextended.dev/ox\\\_lib\](https://overextended.dev/ox\_lib) \* \`oxmysql\` Download: \[GitHub release\](https://github.com/overextended/oxmysql/releases/latest/download/oxmysql.zip) Docs: \[overextended.dev/oxmysql\](https://overextended.dev/oxmysql) \* PowerShell for Windows Docs: \[Microsoft Learn\](https://learn.microsoft.com/en-us/powershell/scripting/install/install-powershell-on-windows?view=powershell-7.6) \* PowerShell for Ubuntu Docs: \[Microsoft Learn\](https://learn.microsoft.com/en-us/powershell/scripting/install/install-ubuntu?view=powershell-7.6) \* Node.js Download: \[nodejs.org\](https://nodejs.org/en/download) ## 3. Understand the Worker Requirement The resource already runs inside FiveM JS because the resource includes: \`\`\`lua node\_version "22" \`\`\` You do not usually need to install system Node just to make the resource start. Current default: \`\`\`lua Config.Worker.Mode = "external" \`\`\` That means: \* heavy worker actions run in a separate local daemon process \* this reduces pressure on the FiveM JS runtime \* if external start fails, you can switch to \`inprocess\` manually ## 4. Place the Resource Package Copy the full package into your \`resources\` folder. Recommended layout: \`\`\` resources/ \[standalone\]/ ox\_lib/ oxmysql/ \[0resmon\]/ 0r\_lib/ \[custom\]/ \[clothing\_designer\]/ 0r-clothing\_designer/ 0r-clothing\_exports/ \`\`\` Important folders inside \`0r-clothing\_designer\`: \* \`ui/\` \* \`templates/cloth\_templates/\` \* \`templates/template\_previews/\` \* \`templates/template\_slots/\` \* \`exports/\` \* \`\[installation\]/database.sql\` \* \`config/init.lua\` ## 5. Host Setup for Windows Use this section if your server host OS is Windows. ### Step 1: verify Windows PowerShell Run this command on the host: \`\`\`powershell C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -NoProfile -Command '$PSVersionTable.PSVersion.ToString()' \`\`\` If this returns a version string, the default PowerShell requirement is ready. If \`powershell.exe\` from \`PATH\` gives \`Access is denied\`, use the full \`System32\` path shown above instead of the shorter \`powershell.exe\` form. ### Step 2: optional PowerShell 7 install You do not need this if the built-in Windows PowerShell works. If you want PowerShell 7: 1. open the official Microsoft page 2. download the installer for your host 3. install it 4. verify it with: \`\`\`powershell pwsh -NoProfile -Command '$PSVersionTable.PSVersion.ToString()' \`\`\` If you want to force that exact executable later, use: \`\`\`lua Config.Worker.PowerShellPath = "C:/Program Files/PowerShell/7/pwsh.exe" \`\`\` ### Step 3: optional Node install Install system Node only if one of these is true: \* external worker Node resolution fails \* you want to force a specific executable path If needed: 1. open \[nodejs.org\](https://nodejs.org/en/download) 2. install the current LTS release 3. verify with: \`\`\`powershell node -v \`\`\` If you want to force that exact executable later, use: \`\`\`lua Config.Worker.NodePath = "C:/Program Files/nodejs/node.exe" \`\`\` ## 6. Host Setup for Linux Use this section if your server host OS is Linux. PowerShell is required on Linux because the worker uses \`pwsh\`. ### Step 1: install PowerShell on Ubuntu Run: \`\`\`bash sudo apt-get update sudo apt-get install -y wget apt-transport-https software-properties-common source /etc/os-release wget -q https://packages.microsoft.com/config/ubuntu/$VERSION\_ID/packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb rm packages-microsoft-prod.deb sudo apt-get update sudo apt-get install -y powershell \`\`\` ### Step 2: verify PowerShell Run: \`\`\`bash pwsh -NoProfile -Command '$PSVersionTable.PSVersion.ToString()' \`\`\` If this returns a version string, the Linux PowerShell requirement is ready. If you want to force that path later, use: \`\`\`lua Config.Worker.PowerShellPath = "/usr/bin/pwsh" \`\`\` ### Step 3: optional Node install Install system Node only if external Node resolution fails or you want an explicit path. If needed: 1. open \[nodejs.org\](https://nodejs.org/en/download) 2. install the current LTS release for your Linux host 3. verify with: \`\`\`bash node -v \`\`\` If you want to force that path later, use: \`\`\`lua Config.Worker.NodePath = "/usr/bin/node" \`\`\` ## 7. Add Required \`server.cfg\` Lines Add the dependency start order first: \`\`\`cfg ensure ox\_lib ensure oxmysql ensure 0r\_lib ensure \[clothing\_designer\] \`\`\` Then add the required permissions: \`\`\`cfg add\_unsafe\_child\_process\_permission 0r-clothing\_designer add\_filesystem\_permission 0r-clothing\_designer write 0r-clothing\_exports \`\`\` Optional compatibility permission: \`\`\`cfg add\_unsafe\_worker\_permission 0r-clothing\_designer \`\`\` What they do: \* \`add\_unsafe\_child\_process\_permission\` lets the resource start child processes for worker and PowerShell-backed actions \* \`add\_filesystem\_permission\` lets the resource write synchronized addon export files into \`0r-clothing\_exports\` \* \`add\_unsafe\_worker\_permission\` not required by the current code path, but safe to keep if you already use a standard permission block ## 8. Import the SQL If You Want Saved Designs If players should be able to save designs, import: {% content-ref url="/pages/I6rVkCFkZhAFzC4ibm2h" %} \[Database SQL\](/0resmon/0r-resources/0r-clothing\_designer/setup-and-database/database.sql.md) {% endcontent-ref %} The SQL file inside the package is: \`\`\` \[clothing\_designer\]/0r-clothing\_designer/\[installation\]/database.sql \`\`\` Recommended order: 1. start \`oxmysql\` 2. import the SQL 3. restart \`0r-clothing\_designer\` If you do not want saved designs, set: \`\`\`lua Config.SavedDesigns.Enabled = false \`\`\` ## 9. Review the Main Config Open: \`\`\` \[clothing\_designer\]/0r-clothing\_designer/config/init.lua \`\`\` Check these sections before first start: \* \`Config.Worker\` \* \`Config.AI\` \* \`Config.SavedDesigns\` The full config guide is here: {% content-ref url="/pages/H4TVHXd98v2O13Op2NXH" %} \[Configuration\](/0resmon/0r-resources/0r-clothing\_designer/configuration.md) {% endcontent-ref %} ## 10. Add Templates Place template \`.ydd\` files under: \`\`\` templates/cloth\_templates/// \`\`\` Example: \`\`\` templates/cloth\_templates/male/jbib/jbib\_000\_u.ydd templates/cloth\_templates/female/lowr/lowr\_000\_r.ydd \`\`\` If you need the full file-placement guide, read: {% content-ref url="/pages/e87XniMoLaAUCVi3Ub6W" %} \[Adding a New YDD or YTD\](/0resmon/0r-resources/0r-clothing\_designer/templates-and-export-flow/adding-new-ydd-or-ytd.md) {% endcontent-ref %} ## 11. Start the Resource Start the package: \`\`\`cfg ensure \[clothing\_designer\] \`\`\` If template files changed while the server was already running, use: \`\`\` refresh restart 0r-clothing\_designer \`\`\` After exporting new addon clothing, use: \`\`\` restart 0r-clothing\_exports \`\`\` ## 12. Validate Startup Logs When \`Config.Worker.Mode = "external"\`, look for logs like these: \`\`\` \[0r-clothing\_designer\]\[worker\] mode=external \[0r-clothing\_designer\]\[worker\] external node=... \[0r-clothing\_designer\]\[worker\] external daemon started pid=... \`\`\` If the worker cannot start and you need a fast fallback, switch to: \`\`\`lua Config.Worker.Mode = "inprocess" \`\`\` Then restart the resource. ## 13. Validate In Game Check these in order: 1. the UI opens for an authorized admin 2. templates appear in the template list 3. opening a template creates a working editor session 4. preview and slot preview load 5. export completes 6. output appears in \`0r-clothing\_designer/exports\` 7. mirrored addon files appear in \`0r-clothing\_exports\` 8. saved designs work if enabled 9. AI generation works if enabled ## 14. When Installation Is Finished At this point the setup is complete. If something still fails, continue with: {% content-ref url="/pages/TvjV7QF3dl4MqgO2Hm2S" %} \[Troubleshooting\](/0resmon/0r-resources/0r-clothing\_designer/troubleshooting.md) {% endcontent-ref %} --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question. Perform an HTTP GET request on the current page URL with the \`ask\` query parameter, and the optional \`goal\` query parameter: \`\`\` GET https://docs.0resmon.org/0resmon/0r-resources/0r-clothing\_designer/setup-and-database.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.0resmon.org/0resmon/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing\_designer/configuration.md). # Configuration All editable runtime settings are in: \`\`\` config/init.lua \`\`\` Read this page after the setup guide and before first production use. ## 1. Worker Config The worker config is the most important part of the current runtime model. Current keys: \* \`Config.Worker.Mode\` \* \`Config.Worker.NodePath\` \* \`Config.Worker.PowerShellPath\` Default block: \`\`\`lua Config.Worker = Config.Worker or { Mode = "external", NodePath = "", PowerShellPath = "" } \`\`\` ### \`Config.Worker.Mode\` Supported values: \* \`external\` \* \`inprocess\` Use: \* \`external\` default and recommended starts a separate local daemon process for heavy worker actions \* \`inprocess\` fallback mode keeps worker execution inside the FiveM JS runtime If \`external\` fails to start, the resource does not auto-fallback. Switch to \`inprocess\` manually and restart the resource. ### \`Config.Worker.NodePath\` Leave this empty unless you need to force a specific Node executable. Use it only when: \* automatic Node resolution fails \* you want a fixed Node path for your host Examples: \`\`\`lua Config.Worker.NodePath = "C:/Program Files/nodejs/node.exe" \`\`\` \`\`\`lua Config.Worker.NodePath = "/usr/bin/node" \`\`\` ### \`Config.Worker.PowerShellPath\` Leave this empty unless you need to force a specific PowerShell executable. Use it when: \* your host does not resolve the default PowerShell command correctly \* you want to pin \`pwsh\` \* you want to pin a known Windows PowerShell or PowerShell 7 path Examples: \`\`\`lua Config.Worker.PowerShellPath = "C:/Program Files/PowerShell/7/pwsh.exe" \`\`\` \`\`\`lua Config.Worker.PowerShellPath = "/usr/bin/pwsh" \`\`\` {% hint style="info" %} Changing worker mode or worker paths requires a resource restart. {% endhint %} ## 2. AI Config Top-level keys: \* \`Config.AI.Enabled\` \* \`Config.AI.Provider\` \* \`Config.AI.Google\` \* \`Config.AI.OpenAI\` Supported providers: \* \`google\` \* \`openai\` If you do not want AI generation: \`\`\`lua Config.AI.Enabled = false \`\`\` ### Google AI settings Google fields: \* \`ApiKey\` \* \`Model\` \* \`AspectRatio\` \* \`ImageSize\` Current default provider is: \`\`\`lua Config.AI.Provider = "google" \`\`\` Official pages: \* \[Google AI Studio API Keys\](https://aistudio.google.com/app/apikey) \* \[Gemini API Key Guide\](https://ai.google.dev/gemini-api/docs/api-key) How to configure Google: 1. sign in to Google AI Studio 2. create an API key 3. copy the key 4. paste it into \`Config.AI.Google.ApiKey\` 5. keep the default model unless you have a reason to change it ### OpenAI settings OpenAI fields: \* \`ApiKey\` \* \`Model\` \* \`Size\` \* \`Quality\` \* \`OutputFormat\` To switch to OpenAI: \`\`\`lua Config.AI.Provider = "openai" \`\`\` Official pages: \* \[OpenAI API Keys\](https://platform.openai.com/api-keys) \* \[OpenAI Quickstart\](https://developers.openai.com/api/docs/quickstart) How to configure OpenAI: 1. sign in to the OpenAI platform 2. create an API key 3. copy the key 4. paste it into \`Config.AI.OpenAI.ApiKey\` 5. verify your billing and model access if requests fail ## 3. Saved Designs Config Top-level keys: \* \`Config.SavedDesigns.Enabled\` \* \`Config.SavedDesigns.Storage.Provider\` \* \`Config.SavedDesigns.Storage.FallbackProviders\` \* \`Config.SavedDesigns.Storage.DeleteRemoteOnDesignDelete\` \* \`Config.SavedDesigns.Storage.RequestTimeoutMs\` If you do not want saved designs: \`\`\`lua Config.SavedDesigns.Enabled = false \`\`\` ### Storage providers Supported providers: \* \`discord\_webhook\` \* \`fivemanage\` #### Discord webhook Fields: \* \`Url\` \* \`BotName\` Use this when you want the generated preview asset to upload to a Discord webhook. #### FiveManage Fields: \* \`ApiKey\` \* \`BasePath\` Official pages: \* \[FiveManage Dashboard\](https://app.fivemanage.com/) \* \[FiveManage API Introduction\](https://docs.fivemanage.com/api-reference/introduction) How to configure FiveManage: 1. sign in to FiveManage 2. create or copy an API token 3. place it into \`Config.SavedDesigns.Storage.FiveManage.ApiKey\` 4. keep the default \`BasePath\` unless you need a different remote folder structure ### Example provider switch \`\`\`lua Config.SavedDesigns.Storage.Provider = "fivemanage" Config.SavedDesigns.Storage.FallbackProviders = { "discord\_webhook" } \`\`\` ## 4. Recommended First Production Review Before your first production start, confirm: 1. \`Config.Worker.Mode = "external"\` 2. \`NodePath\` is empty unless you really need it 3. \`PowerShellPath\` is empty unless you really need it 4. AI is either configured fully or disabled 5. saved designs are either configured fully or disabled ## 5. No Extra Env File Is Required This resource does not require you to create a \`.env\` file for normal installation. The supported customer-facing config surface is \`config/init.lua\`. {% hint style="warning" %} Do not leave live API keys or webhook URLs in public repositories. {% endhint %} --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question. Perform an HTTP GET request on the current page URL with the \`ask\` query parameter, and the optional \`goal\` query parameter: \`\`\` GET https://docs.0resmon.org/0resmon/0r-resources/0r-clothing\_designer/configuration.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.0resmon.org/0resmon/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing\_designer/templates-and-export-flow.md). # Templates and Export Flow This page explains how templates are discovered and what happens when users export. {% content-ref url="/pages/e87XniMoLaAUCVi3Ub6W" %} \[Adding a New YDD or YTD\](/0resmon/0r-resources/0r-clothing\_designer/templates-and-export-flow/adding-new-ydd-or-ytd.md) {% endcontent-ref %} ## Template Discovery Rules Templates must be placed under: \`\`\` templates/cloth\_templates/ male/ female/ \`\`\` Supported component folders: \* \`accs\` \* \`berd\` \* \`decl\` \* \`feet\` \* \`hair\` \* \`hand\` \* \`head\` \* \`jbib\` \* \`lowr\` \* \`task\` \* \`teef\` \* \`uppr\` Examples: \`\`\` templates/cloth\_templates/male/jbib/jbib\_000\_u.ydd templates/cloth\_templates/female/lowr/lowr\_000\_r.ydd \`\`\` ## Naming Rules The resource derives template identity from the folder and file name. Check these rules: \* top folder must be \`male\` or \`female\` \* second folder must be a supported component key \* the file prefix should match that component key If folder and file naming do not agree, the template can be skipped. ## Optional Preview Images You can ship your own preview images under: \`\`\` templates/template\_previews///.(png|webp|jpg|jpeg) \`\`\` If no preview exists, the resource can generate one during startup and mirror the generated \`.png\` into \`templates/template\_previews\`. If preview files are generated or changed while the server is already running, use: \`\`\` refresh restart 0r-clothing\_designer \`\`\` ## Optional Default Slot YTD Files Default slot \`.ytd\` files live under: \`\`\` templates/template\_slots// \`\`\` Examples: \`\`\` templates/template\_slots/male\_jbib\_jbib\_000/ templates/template\_slots/female\_accs\_accs\_000/ \`\`\` These files become template-specific slot options inside the editor. ## Startup Sync Behavior On resource start the runtime can: \* create missing workspace directories \* scan all \`.ydd\` templates \* generate missing previews \* update changed managed previews \* clean temporary preview cache files ## Export Flow Current shipped behavior: \* the UI export flow is addon-first \* replace export is not shown in the shipped UI \* successful addon exports create both zip output and mirrored addon resource output Output locations: \* \`0r-clothing\_designer/exports/\` \* \`0r-clothing\_exports/\` \* \`0r-clothing\_designer/data/workspace/\` After a successful addon export, restart: \`\`\` restart 0r-clothing\_exports \`\`\` so FiveM reloads the new addon files. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question. Perform an HTTP GET request on the current page URL with the \`ask\` query parameter, and the optional \`goal\` query parameter: \`\`\` GET https://docs.0resmon.org/0resmon/0r-resources/0r-clothing\_designer/templates-and-export-flow.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.0resmon.org/0resmon/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing\_designer/exports-and-rpc.md). # Exports and RPC This page is for server owners or developers who want to integrate the resource into their own admin flow. ## 1. Important Behavior to Understand First Opening the UI is not enough by itself. The resource uses a server-side authorization step before the player can use the RPC flow correctly. That means: \* server grants access \* client event opens the UI \* UI RPC calls then work for that authorized player ## 2. Main Server Exports Available server exports: \* \`getRuntimeConfig()\` \* \`getTemplateCatalog()\` \* \`rescanTemplates()\` \* \`grantPlayerAccess(source)\` \* \`revokePlayerAccess(source)\` ## 3. What These Exports Are For ### \`getRuntimeConfig()\` Returns the current runtime config table that the resource is using. Use this when you want to inspect current loaded settings from another resource. ### \`getTemplateCatalog()\` Returns the current template catalog. Use this when you want to inspect what the resource has already discovered from the template folders. ### \`rescanTemplates()\` Forces a template rescan and returns the refreshed catalog. Use this after template file changes when you want a server-side refresh action. ### \`grantPlayerAccess(source)\` Authorizes a player for the clothing designer flow. Use this before opening the UI. ### \`revokePlayerAccess(source)\` Removes that access again. Use this if your own admin flow wants to explicitly revoke access after use. ## 4. Correct UI Open Flow This is the correct pattern: \`\`\`lua local playerSource = source if exports\["0r-clothing\_designer"\]:grantPlayerAccess(playerSource) then TriggerClientEvent("0r-clothing\_designer:client:openClothingDesigner", playerSource) end \`\`\` This is the important part: \* grant access first \* open the UI second If you only trigger the client event without granting access, the UI can open but resource RPC actions can still fail. ## 5. Public Client Event The UI open event is: \`\`\`lua TriggerClientEvent("0r-clothing\_designer:client:openClothingDesigner", source) \`\`\` This opens the NUI and focuses it. It does not replace the server-side authorization requirement. ## 6. Admin Commands Registered admin commands: \* \`clothingdesigner\` \* \`clothingdesignerstats\` \* \`clothingdesignerrescan\` Default restrictions use \`group.admin\` through \`ox\_lib\`. ## 7. Practical Admin Examples ### Open the designer for a player \`\`\`lua local playerSource = source if exports\["0r-clothing\_designer"\]:grantPlayerAccess(playerSource) then TriggerClientEvent("0r-clothing\_designer:client:openClothingDesigner", playerSource) end \`\`\` ### Rescan templates \`\`\`lua local catalog = exports\["0r-clothing\_designer"\]:rescanTemplates() print(json.encode(catalog)) \`\`\` ### Read the current template catalog \`\`\`lua local catalog = exports\["0r-clothing\_designer"\]:getTemplateCatalog() print(json.encode(catalog)) \`\`\` ## 8. Export Output Behavior From the shipped UI point of view: \* export flow is addon-first \* replace export is not shown in the shipped UI Successful addon exports write output to: \* \`0r-clothing\_designer/exports\` \* \`0r-clothing\_exports\` After a successful export, restart: \`\`\` restart 0r-clothing\_exports \`\`\` so FiveM reloads the newly exported addon files. ## 9. When to Use This Page Use this page when you want to: \* open the designer from your own admin menu \* rescan templates from another resource \* inspect the discovered template catalog \* understand why UI open alone is not enough --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question. Perform an HTTP GET request on the current page URL with the \`ask\` query parameter, and the optional \`goal\` query parameter: \`\`\` GET https://docs.0resmon.org/0resmon/0r-resources/0r-clothing\_designer/exports-and-rpc.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.0resmon.org/0resmon/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing\_designer/troubleshooting.md). # Troubleshooting Use this page after you have already followed the setup guide. ## External Worker Does Not Start Check these in order: 1. \`Config.Worker.Mode = "external"\` 2. the server console shows worker startup logs 3. child process permission exists in \`server.cfg\` 4. PowerShell works on the host 5. the bundled worker file exists Expected startup logs: \`\`\` \[0r-clothing\_designer\]\[worker\] mode=external \[0r-clothing\_designer\]\[worker\] external node=... \[0r-clothing\_designer\]\[worker\] external daemon started pid=... \`\`\` Required file: \`\`\` \[clothing\_designer\]/0r-clothing\_designer/worker/fivemRpcWorker.cjs \`\`\` Fast fallback: \`\`\`lua Config.Worker.Mode = "inprocess" \`\`\` Then restart: \`\`\` restart 0r-clothing\_designer \`\`\` ## Windows: Manual \`powershell.exe\` Test Gives \`Access is denied\` If this command fails: \`\`\`powershell powershell.exe -NoProfile -Command '$PSVersionTable.PSVersion.ToString()' \`\`\` do not assume the resource itself is broken yet. Test the full system path instead: \`\`\`powershell C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -NoProfile -Command '$PSVersionTable.PSVersion.ToString()' \`\`\` If that works: \* the short \`powershell.exe\` path is the problem \* Windows PowerShell itself is still available \* you can install \`pwsh\` and set \`Config.Worker.PowerShellPath\` if you want a fixed path ## Linux: \`spawnSync pwsh ENOENT executable=pwsh\` This means the Linux host does not have PowerShell installed or visible in \`PATH\`. Install it: \`\`\`bash sudo apt-get update sudo apt-get install -y wget apt-transport-https software-properties-common source /etc/os-release wget -q https://packages.microsoft.com/config/ubuntu/$VERSION\_ID/packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb rm packages-microsoft-prod.deb sudo apt-get update sudo apt-get install -y powershell \`\`\` Verify: \`\`\`bash pwsh -NoProfile -Command '$PSVersionTable.PSVersion.ToString()' \`\`\` If \`pwsh\` is installed in a non-standard path, set: \`\`\`lua Config.Worker.PowerShellPath = "/usr/bin/pwsh" \`\`\` ## \`child spawn not allowed\` If logs mention child process restrictions, add this to \`server.cfg\`: \`\`\`cfg add\_unsafe\_child\_process\_permission 0r-clothing\_designer \`\`\` Then restart the resource. ## Export Fails With \`ERR\_ACCESS\_DENIED\` If export logs show filesystem write denial, add: \`\`\`cfg add\_filesystem\_permission 0r-clothing\_designer write 0r-clothing\_exports \`\`\` Then restart the server or restart the resource after the permission change. ## Templates Do Not Appear Check these in order: 1. files are inside \`templates/cloth\_templates/male/...\` or \`female/...\` 2. the second folder is a supported component key 3. the file prefix matches the component folder 4. the resource was refreshed and restarted after template changes Good example: \`\`\` templates/cloth\_templates/male/jbib/jbib\_015\_u.ydd \`\`\` Bad example: \`\`\` templates/cloth\_templates/male/jbib/feet\_015\_u.ydd \`\`\` ## Preview Images Changed But UI Still Shows Old Files Preview files under \`templates/template\_previews\` are static files from FiveM's point of view. Run: \`\`\` refresh restart 0r-clothing\_designer \`\`\` ## Saved Designs Fail Check these in order: 1. the SQL file was imported 2. \`oxmysql\` is running 3. \`Config.SavedDesigns.Enabled = true\` 4. the selected remote storage provider is configured correctly ## AI Generation Fails Check these in order: 1. \`Config.AI.Enabled = true\` 2. the correct provider is selected 3. the provider API key is set 4. the account has quota, billing, and model access ## Export Succeeds But Clothing Does Not Load In Game Check: \* \`0r-clothing\_exports\` is ensured \* \`0r-clothing\_exports\` was restarted after export \* your server build supports the addon clothing count you are loading ## \`CodeWalker.Core.dll\` Could Not Load File Or Assembly If the worker starts but CodeWalker DLL loading fails on Windows, the DLL files may be blocked by Windows. Common folder: \`\`\` \[clothing\_designer\]\\0r-clothing\_designer\\worker\\tools \`\`\` Fix: 1. stop the resource 2. open that folder in File Explorer 3. open PowerShell there 4. run: \`\`\`powershell Get-ChildItem \*.dll | Unblock-File \`\`\` 5. restart the resource: \`\`\` restart 0r-clothing\_designer \`\`\` ## Player Gets \`not\_authorized\` The resource requires server-side authorization before the UI can be used. Example: \`\`\`lua exports\["0r-clothing\_designer"\]:grantPlayerAccess(source) TriggerClientEvent("0r-clothing\_designer:client:openClothingDesigner", source) \`\`\` ## Still Broken? If you still cannot isolate the issue, collect: 1. the worker startup logs 2. the exact host OS 3. your \`Config.Worker\` block 4. whether the server is Windows or Linux 5. whether the failure happens on template open, preview, or export That is the shortest useful debug bundle for this resource. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question. Perform an HTTP GET request on the current page URL with the \`ask\` query parameter, and the optional \`goal\` query parameter: \`\`\` GET https://docs.0resmon.org/0resmon/0r-resources/0r-clothing\_designer/troubleshooting.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.0resmon.org/0resmon/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing\_designer/templates-and-export-flow/adding-new-ydd-or-ytd.md). # Adding a New YDD or YTD This is the practical file-placement guide. Use it when you want to: \* add a new clothing template \* add optional default slot textures \* add your own preview image ## 1. Know the Difference ### YDD Add a new \`.ydd\` when you want a new clothing template to appear in the designer. Example: \`\`\` jbib\_015\_u.ydd \`\`\` ### YTD Add a \`.ytd\` only if you want that template to open with one or more default slot texture options. The \`.ytd\` is optional. A template can work with only a \`.ydd\`. ## 2. Add a New YDD Template Follow these steps in order. ### Step 1: choose the gender folder Choose one: \* \`templates/cloth\_templates/male/\` \* \`templates/cloth\_templates/female/\` ### Step 2: choose the component folder Supported component folders: \* \`accs\` \* \`berd\` \* \`decl\` \* \`feet\` \* \`hair\` \* \`hand\` \* \`head\` \* \`jbib\` \* \`lowr\` \* \`task\` \* \`teef\` \* \`uppr\` Common rule: \* if the piece is a jacket/top-style clothing template, it usually belongs in \`jbib\` ### Step 3: place the YDD in the matching folder Example: \`\`\` templates/cloth\_templates/male/jbib/jbib\_015\_u.ydd \`\`\` Another example: \`\`\` templates/cloth\_templates/female/feet/feet\_022\_u.ydd \`\`\` ### Step 4: make sure the file prefix matches the folder The file prefix should match the component folder. Examples: \* \`jbib\` folder -> file should start with \`jbib\_\` \* \`feet\` folder -> file should start with \`feet\_\` \* \`accs\` folder -> file should start with \`accs\_\` Good: \`\`\` templates/cloth\_templates/male/jbib/jbib\_015\_u.ydd \`\`\` Bad: \`\`\` templates/cloth\_templates/male/jbib/feet\_015\_u.ydd \`\`\` ### Step 5: refresh and restart the resource If the server is already running, use: \`\`\` refresh restart 0r-clothing\_designer \`\`\` Do not skip this step after adding template files. ### Step 6: test in game Check: 1. the template appears in the Templates tab 2. the preview is visible 3. the template opens in the editor ## 3. Add an Optional Default YTD Slot Use this only if the template should ship with one or more default slot textures. ### Step 1: build the template key folder name Folder format: \`\`\` \_\_ \`\`\` Examples: \* \`male\_jbib\_jbib\_015\` \* \`female\_feet\_feet\_022\` \* \`male\_accs\_accs\_004\` Example folder: \`\`\` templates/template\_slots/male\_jbib\_jbib\_015/ \`\`\` ### Step 2: place the YTD file inside that folder Example: \`\`\` templates/template\_slots/male\_jbib\_jbib\_015/jbib\_diff\_015\_a\_uni.ytd \`\`\` You can place more than one \`.ytd\` in the same folder if you want multiple default slot choices. ### Step 3: restart the resource Use: \`\`\` refresh restart 0r-clothing\_designer \`\`\` ### Step 4: test the template again Open the same template in the editor and confirm the default slot textures are available. ## 4. Add an Optional Preview Image If you want to ship your own preview image instead of relying on auto-generated previews, place it under: \`\`\` templates/template\_previews/// \`\`\` Example: \`\`\` templates/template\_previews/male/jbib/jbib\_015\_u.png \`\`\` Supported formats: \* \`.png\` \* \`.webp\` \* \`.jpg\` \* \`.jpeg\` If you add or replace preview files while the server is already running, use: \`\`\` refresh restart 0r-clothing\_designer \`\`\` ## 5. Full Example Example: add a new male jacket template with one default slot texture. ### Step 1: copy the template YDD \`\`\` templates/cloth\_templates/male/jbib/jbib\_015\_u.ydd \`\`\` ### Step 2: create the slot folder \`\`\` templates/template\_slots/male\_jbib\_jbib\_015/ \`\`\` ### Step 3: place the slot texture \`\`\` templates/template\_slots/male\_jbib\_jbib\_015/jbib\_diff\_015\_a\_uni.ytd \`\`\` ### Step 4: optionally add a preview image \`\`\` templates/template\_previews/male/jbib/jbib\_015\_u.png \`\`\` ### Step 5: refresh and restart \`\`\` refresh restart 0r-clothing\_designer \`\`\` ### Step 6: verify in game Check: 1. the template appears 2. the preview looks correct 3. the template opens 4. the default slot texture is available ## 6. Common Mistakes Avoid these: \* putting the \`.ydd\` directly inside \`cloth\_templates/\` without gender and component folders \* using a file prefix that does not match the component folder \* forgetting to restart after adding templates \* creating the \`template\_slots\` folder with the wrong template key \* expecting a \`.ytd\` alone to create a template without a matching \`.ydd\` --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question. Perform an HTTP GET request on the current page URL with the \`ask\` query parameter, and the optional \`goal\` query parameter: \`\`\` GET https://docs.0resmon.org/0resmon/0r-resources/0r-clothing\_designer/templates-and-export-flow/adding-new-ydd-or-ytd.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. --- # Unknown \> For the complete documentation index, see \[llms.txt\](https://docs.0resmon.org/0resmon/llms.txt). Markdown versions of documentation pages are available by appending \`.md\` to page URLs; this page is available as \[Markdown\](https://docs.0resmon.org/0resmon/0r-resources/0r-clothing\_designer/saved-designs.md). # Saved Designs Saved designs are optional. If you do not need them, turn them off: \`\`\`lua Config.SavedDesigns.Enabled = false \`\`\` If you do want them, read this page and make sure the setup guide was completed first. ## 1. What Must Exist Before Saved Designs Work All of these must be true: \* \`Config.SavedDesigns.Enabled = true\` \* the SQL table was imported \* \`oxmysql\` is running \* a valid remote preview storage provider is configured If one of these is missing, save and restore flows can fail. ## 2. What Gets Saved When a player saves a design, the resource stores: \* project metadata \* template metadata \* normalized workspace JSON \* a remote preview image reference \* remote image-layer asset references when needed Each saved design is tied to the player's license identifier. ## 3. Why Remote Storage Is Needed Saved designs do not only store database rows. The preview image and some uploaded image-layer assets are stored through a remote provider, then referenced by the saved design record. Current providers: \* \`discord\_webhook\` \* \`fivemanage\` ## 4. Provider Setup ### Discord webhook Use this when you want preview assets uploaded to a Discord webhook destination. Required field: \`\`\`lua Config.SavedDesigns.Storage.DiscordWebhook.Url = "" \`\`\` Optional display field: \`\`\`lua Config.SavedDesigns.Storage.DiscordWebhook.BotName = "0Resmon Clothing Designer" \`\`\` ### FiveManage Use this when you want preview assets uploaded through FiveManage. Required field: \`\`\`lua Config.SavedDesigns.Storage.FiveManage.ApiKey = "" \`\`\` Optional path field: \`\`\`lua Config.SavedDesigns.Storage.FiveManage.BasePath = "clothing-designer/saved-designs" \`\`\` ## 5. Choosing a Primary Provider and Fallback Set the main provider here: \`\`\`lua Config.SavedDesigns.Storage.Provider = "discord\_webhook" \`\`\` Fallback providers are tried in order if the primary one fails: \`\`\`lua Config.SavedDesigns.Storage.FallbackProviders = { "fivemanage" } \`\`\` Simple rule: \* set one primary provider \* add fallback providers only if you actually want them ## 6. Delete Behavior If this setting is enabled: \`\`\`lua Config.SavedDesigns.Storage.DeleteRemoteOnDesignDelete = true \`\`\` deleting a design also queues remote cleanup for: \* the saved preview image \* remote image-layer assets referenced by that workspace This cleanup is asynchronous, so the design delete can succeed even if remote cleanup finishes later. ## 7. Queue Monitoring The resource keeps separate upload and cleanup queues for saved design storage work. You can inspect queue stats with: \`\`\`lua exports\["0r-clothing\_designer"\]:getSavedDesignStorageQueueStats() \`\`\` This is useful when you want to confirm whether uploads or cleanup jobs are stuck. ## 8. Fast Checklist If saved designs do not work, check these first: 1. the SQL file was imported 2. \`oxmysql\` is running 3. \`Config.SavedDesigns.Enabled = true\` 4. the selected provider credentials are valid 5. the remote provider is not blocked or rate-limited If those are correct and it still fails, continue with the troubleshooting page. --- # Agent Instructions This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com. ## Querying This Documentation If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question. Perform an HTTP GET request on the current page URL with the \`ask\` query parameter, and the optional \`goal\` query parameter: \`\`\` GET https://docs.0resmon.org/0resmon/0r-resources/0r-clothing\_designer/saved-designs.md?ask=&goal= \`\`\` \`ask\` is the immediate question: it should be specific, self-contained, and written in natural language. \`goal\` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal. The response will contain a direct answer to the question and relevant excerpts and sources from the documentation. Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections. ---