> For the complete documentation index, see [llms.txt](https://oph3zdev.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://oph3zdev.gitbook.io/docs/paid-scripts/inventory/using-another-appearance-script.md).

# Using another appearance script?

The metadata item systems (clothing, bags and vests as real items) are not welded to one appearance script. The inventory connects to whatever resource `Config.AppearanceResource` names, through a small contract called the **clothing bridge**. This page is for the developer of that appearance script - implement the steps below and item clothing works with your script. The included appearance script is the reference implementation.

If you do not want item clothing at all, none of this is needed: set the three metadata switches to `false` and everything runs classic.

### Step 1 - The handshake

Add this export on **both client and server**. On startup the inventory calls it on your resource - any non-empty `name` passes, and it is printed in the server console on connect. If the export is missing, the inventory says so in the console and runs classic mode.

```lua
exports("ClothingBridge", function()
    return { name = "my-appearance", version = 1 }
end)
```

### Step 2 - Dressing exports (client)

The inventory dresses the ped through these two client exports whenever a clothing item is worn or taken off.

```lua
exports("setPedComponent", function(data)
    -- data = { component_id, drawable, texture }
end)

exports("setPedProp", function(data)
    -- data = { prop_id, drawable, texture }, drawable -1 = clear
end)
```

They must do three things:

1. Apply the piece immediately.
2. Keep it applied when your script re-applies the player's saved skin.
3. Never save it into your outfit system - the inventory owns those components while an item is worn.

### Step 3 - Tell the inventory when to step back

Two calls from your script into the inventory. Pause item clothing while your clothing menu is open (so the player can preview freely), and resume after:

```lua
exports["oph3z-inventory"]:SetClothingPaused(true)  -- menu opens
exports["oph3z-inventory"]:SetClothingPaused(false) -- menu closes
```

And after applying a full skin (spawn, menu close, /reloadskin), tell the inventory to re-dress the ped with the worn items:

```lua
TriggerEvent("oph3z-inventory:resetClothing")
```

### Step 4 - Optional: gloves

GTA glove drawables contain the arms, so gloves need translation between arm styles. Implement these client exports for full glove support. Without them nothing breaks - gloves simply do not show and arms fall back to the bare look.

```lua
exports("AdaptGloveDrawable", function(gender, gloveDrawable, bareArms)
    return adaptedDrawable -- or nil when no variant fits
end)

exports("GloveBareOf", function(gender, drawable)
    return bareArmsDrawable -- or nil when the drawable is not a glove
end)
```

### Step 5 - Test it

1. Set `Config.AppearanceResource = "my-appearance"` in the inventory's <mark style="color:$primary;">config/config.lua</mark> and turn on `Config.MetadataClothingSystem`.
2. Restart the inventory. The console prints the connected script's name on success - or exactly what is missing, and falls back to classic mode.
3. In game: wear a clothing item, take it off, open and close your clothing menu, and /reloadskin - the ped should dress and undress correctly every time.

### Selling clothing from your store

A clothing item is a normal item (`type = "clothing"`, an `equipSlot`) whose metadata says which garment it is:

```lua
exports["oph3z-inventory"]:AddItem(src, "clothing_hat", 1, {
    drawable = 5,
    texture = 2,
    gender = "male"
})
```

Generic per-slot items (`clothing_hat`, `clothing_mask`, ...) ship with the inventory, so your store can sell any garment by stamping the metadata - buy-to-bag, nothing auto-equips. Useful extras for deeper integration:

* `exports["oph3z-inventory"]:GetAppearanceModes()` - read which modes are active, so one script supports both classic and item mode.
* `exports["oph3z-inventory"]:ApplyClothingToPed(ped, equipment)` (client) and `GetEquipmentFor(identifier)` (server) - dress preview or multicharacter peds with a player's worn items.
* Garment thumbnails: host them in your resource and point the inventory's `Config.ClothingImageUrl` at them, and clothing item tiles show the real garment.

### Checklist

* `ClothingBridge` export on client and server
* `setPedComponent` / `setPedProp` client exports that survive skin re-applies
* `SetClothingPaused(true/false)` around your clothing menu
* `oph3z-inventory:resetClothing` after every full skin apply
* Optional: `AdaptGloveDrawable` / `GloveBareOf` for gloves
* Console shows your script's name after restarting the inventory
