Custom Variants

Customizing Clothing Variants

Beyond the default "no clothing" options, the Clothing Menu allows for extensive customization of outfits through custom variants. These variants let you define specific clothing combinations that players can toggle on or off with a single click.

Structure of Custom Variants

Config.customVariants = {
    [`ped_model`] = {
        [variant_name] = {
            [clothing_item] = {
                itemIds = { 
                    drawable = drawable_id,
                    ids = { id1, id2, ... }  -- Array of selected IDs
                },
                table = {
                    { drawable = drawable_id, id = texture_id, texture = palette_id },
                    -- More items (optional)
                },
                animation = 'animation_name',  -- (optional)
            },
            -- More clothing items...
        },
        -- More variants...
    },
    -- More ped models...
}
  • ped_model: A string representing the player model name (e.g., 'mp_m_freemode_01' for the male model).

  • variant_name: A string you choose to identify this specific variant (e.g., 'fat').

  • clothing_item: A string representing the type of clothing item (e.g., top, pants).

  • itemIds: A table specifying which clothing items to replace with this variant:

    • drawable: The drawable ID of the clothing component.

    • ids: An array of texture IDs that, when equipped, will trigger this variant.

  • table: An array of tables defining the clothing components for this variant. Each table has the same structure as in Config.defaultVariants:

    • drawable: The drawable ID of the clothing component.

    • id: The texture ID of the clothing component.

    • texture: The palette ID of the clothing component (if applicable).

  • animation (optional): The name of the animation to play when equipping or removing the item.

Example Configuration

Config.customVariants = {
    [`mp_m_freemode_01`] = {
        ['fat'] = {
            ['top'] = {
                itemIds = {
                    drawable = 11,   -- Jackets
                    ids = { 526, 669 }  -- Specific jacket IDs to replace
                },
                table = {
                    { drawable = 11, id = 15, texture = 0 },  -- Black suit jacket
                    { drawable = 3,  id = 14, texture = 0 },  -- Torso overlay
                },
                animation = 'top'
            },
            ['pants'] = {
                itemIds = {
                    drawable = 4,    -- Pants
                    ids = { 193, 290 } -- Specific pants IDs to replace
                },
                table = {
                    { drawable = 4, id = 14, texture = 1 },  -- Custom pants
                },
                animation = 'pants'
            },
        }
    },
    -- ... more ped models and variants
}

In this example:

  • If a male player (mp_m_freemode_01) is wearing a jacket with IDs 526 or 669, and they toggle the 'fat' variant, the script will replace their outfit with the defined 'fat' variant clothing.

  • The 'fat' variant for the top includes a black suit jacket and a torso overlay.

  • The 'fat' variant for pants is a single custom pants item.

Key Points:

  • Flexibility: You can create as many custom variants as you like for each ped_model.

  • Any Ped Model: Unlike Config.defaultVariants, you can use any ped model in Config.customVariants.

  • Mixing and Matching: Players can combine default clothing with custom variants.

Last updated