Koja Scripts
Cloth Tool

First Project

This walkthrough takes you from an empty window to a FiveM resource you can drop straight into your server.

First Project

This walkthrough takes you from an empty window to a FiveM resource you can drop straight into your server. It should take about ten minutes.

  1. Create a project

    From the Home screen choose New Project, give it a name and pick a folder. Prefer to learn by example? Pick Explore Sample on the Home screen instead.
  2. Add an item

    Each garment is an item. Add one, then set its basics in the right‑hand editor:
    • Gender — Male or Female. Items live under the gender toggle in the left panel.
    • Type — component (a body part like a top or trousers) or prop (hat, glasses, ears…).
    • Drawable type / slot — e.g. Top (jbib), Legs (lowr), Undershirt (accs), Hat (p_head). This decides which body slot the garment fills.
    • Number — the drawable number the item takes in that slot.
    • Name — a friendly label for you; it doesn't affect the game.
  3. Import your model & textures

    With the item selected, click Import .ydd / .ytd and choose your files.
    • The .ydd becomes the item's model.
    • Each .ytd becomes a texture variant (a colour/pattern option), shown as a swatch. Add as many as you like — variant letters (a, b, c…) are assigned in order.
    • Need to attach a texture to a specific variant later? Use the 📎 button on that variant row.
    The 3D preview updates as soon as the files load.
  4. Preview on the ped

    The centre panel shows your garment on a real freemode ped, wearing your actual textures.
    • Orbit with the left mouse button, pan with Shift+drag, zoom with the wheel.
    • Open the ⚙ Options flyout to toggle wireframe, grid, floor, auto‑rotate and textures, switch LOD, and adjust brightness / ambient lighting if the model looks dark.
    • Change the base ped components (skin, hair, other clothing) to see how your garment sits with the rest of an outfit.
    See 3D Preview for everything this panel can do.
  5. Right‑click a texture (or an item) and choose Optimize. The tool will:
    • resize to the nearest power‑of‑two size,
    • recompress to the correct BCn format for the map type, and
    • generate mipmaps.
    This shrinks your pack and prevents the "not power of two" / "no mipmaps" problems that plague hand‑made packs. See Texture Optimization.
  6. Run the Cloth Doctor

    Before building, let the Cloth Doctor validate the project. It flags missing textures, bad naming, non‑power‑of‑two sizes, duplicate drawable numbers, gender/slot limit overflows and more — with suggested fixes. Clear the reds and you're safe to ship.
  7. Build

    Hit Build, set a collection name (the add‑on name for your pack) and choose the FiveM target. The tool writes a complete resource:
    your_pack/
    ├─ stream/
    │  ├─ mp_m_freemode_01_koja^jbib_000_u.ydd
    │  ├─ mp_m_freemode_01_koja^jbib_diff_000_a_uni.ytd
    │  ├─ mp_m_freemode_01_koja.ymt
    │  └─ ...
    ├─ mp_m_freemode_01_koja_shop.meta
    ├─ fxmanifest.lua
    └─ ...
    
    • Files are renamed to the exact GTA add‑on convention automatically (including your collection name).
    • The .ymt and shop.meta that make items selectable in‑game are generated for you.
    • A ready fxmanifest.lua registers everything.
    • Drop the folder into your server's resources, add it to your server.cfg, and start it.
  • Installation — Download the tool, connect your account, link GTA V, and start your first project.
  • Start Here — back to the section overview