> For the complete documentation index, see [llms.txt](https://docs.dovux.gg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dovux.gg/scripts/clothing/exports-and-events.md).

# Exports & Events

Here you will find everything you need to work

### Exports:

Use it for when they just enter the server and you need to have everything available to customize and at the same time be free

<pre class="language-lua"><code class="lang-lua"><strong>-- @return true when the firstcustomization is done
</strong><strong>local result = exports['dx_clothing']:StartFirstCustomization()
</strong></code></pre>

**You can open the menus**

```lua
-- @param type 'firstcustom' | 'clothing' | 'barber' | 'tattoos'

exports['dx_clothing']:StartCustomization(type)
```

**To open the outfits menu**

```lua
-- @param IsInStore  boolean   Will allow to create and delete outfits
exports['dx_clothing']:OpenOutfitMenu(IsInStore)

--@param IsInStore if is true then can't return to the main menu but
-- if is false then can return to the main menu
exports['dx_clothing']:openJobsOutfitMenu(IsInStore)
```

**To set ped appearance**

<pre class="language-lua"><code class="lang-lua">-- @param ped   number    The entity player.
-- @param data  string    The appearance data to apply to the player character.
<strong>exports['dx_clothing']:setPedAppearance(ped, data)
</strong></code></pre>

**To set player model**

```lua
-- @param skin string
local skin = 'mp_m_freemode_01'
exports['dx_clothing']:setPlayerModel(skin)
```

### **Events**

#### **To load skin model by JSON**

```lua
-- @param skin string The appearance data to apply to the current player character.
TriggerEvent('dx_clothing:loadSkin', skin) --skin alway needs to be string objet
```

**To set ped appearance**

```lua
-- @param ped   number    The entity player.
-- @param data  string    The appearance data to apply to the player character.
TriggerEvent('dx_clothing:setPedAppearance', ped, data)
```

**To reload current character tattoos you can use:**

```lua
TriggerEvent('dx_clothing:load:pedTattoos')
```

**Event Handlers**

```lua
AddEventHandler('dx_clothing:onclose', function()
    print('Clothing menu closed')
end)

AddEventHandler('dx_clothing:on:save', function(paymentType, price, playerApearance)
    print('Payment type: ' .. paymentType)
    print('Price: ' .. price)
    print('Player apearance: ' .. json.encode(playerApearance, {indent = true}))
end)
```
