# Clothing

{% hint style="success" %}
File Path: <kbd>modules/systems/c.clothing.lua</kbd>
{% endhint %}

***

```lua
function SetPlayerOutfit(clothingConfig)
    SetPreviousClothing()
    local ped = PlayerPedId()
    for category, value in pairs(clothingConfig) do
        if ClothingData.variations[category] then
            PreviousClothing[category] = {GetPedDrawableVariation(ped, ClothingData.variations[category]), GetPedTextureVariation(ped, ClothingData.variations[category])}
            SetPedComponentVariation(ped, ClothingData.variations[category], value[1], value[2], 2)
        elseif ClothingData.props[category] then
            PreviousClothing[category] = {GetPedPropIndex(ped, ClothingData.props[category]), GetPedPropTextureIndex(ped, ClothingData.props[category])}
            SetPedPropIndex(ped, ClothingData.props[category], value[1], value[2], true)
        end
    end 
end

function SetPreviousClothing()
    local ped = PlayerPedId()
    for category, value in pairs(PreviousClothing) do
        if ClothingData.variations[category] then
            SetPedComponentVariation(ped, ClothingData.variations[category], value[1], value[2], 2)
        elseif ClothingData.props[category] then
            if value[1] == -1 then
                ClearPedProp(ped, ClothingData.props[category])
            else 
                SetPedPropIndex(ped, ClothingData.props[category], value[1], value[2]+1, true)
            end
        end
    end
    PreviousClothing = {}
end 
```


---

# Agent Instructions: 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:

```
GET https://docs.devhub.gg/scripts/devhub_lib-needed-for-each-script/clothing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
