For the complete documentation index, see llms.txt. This page is also available as Markdown.

config.lua

The main settings. Shops, clothe prices and lists, hidden clothes, masks and armor are set in the admin panel.

-- Docs: https://tgiann.gitbook.io/tgiann/scripts/tgiann-clothing
-- ℹ️ With the 'skinadmin' command, you can see the collection names, index and texture index numbers of the clothes you are wearing.

tgiCoreExports = exports["tgiann-core"]
config = tgiCoreExports:getConfig()
config.langs = {}

-- Set this setting to false if you are not using tgiann-inventory or do not want clothes to be items
-- if you are using tgiann-inventory, make this and the Config.clothingAsItem setting in inventory the same
-- false version; https://youtu.be/IflmFDyMCnE?t=80
config.clothingAsItem = true

-- if true, the player can change the ped when creating character, change the ped list from "pedList.lua"
config.pedListEnable = true

-- shows a picture of clothes in ui (https://docs.tgiann.com/scripts/tgiann-clothing/how-to-take-clothes-images)
config.showClotheImg = true

-- If true, the screen will fade out when the character creation menu is opened
config.fadeOutScreenWhenCreatingCharacter = true

-- If true, the screen will fade out when the character is loading
config.fadeOutScreenWhenLoadingCharacter = true

-- If this setting is true, and the "clothe as item" feature is enabled, the ped created when purchasing clothing for the opposite gender will be synchronized with other players.
config.syncOtherShopPed = true

-- Accounts the player can pay with in the shop menus, picked at checkout (the first one is selected by default)
-- "cash", "bank" or any other account your framework has (e.g. "black_money"); add ACCOUNT_<NAME> to the language file for its label
config.paymentAccounts = { "cash", "bank" }

-- Gen9 exclusive items (PS5/Xbox Series only) cannot be applied on PC/FiveM.
-- When enabled, these items are filtered out from the clothing menu.
-- Maybe one day gen9 exclusive clothes can be worn for fivem too, when that happens you can set this setting to false and gen9 clothes will appear in the menu
config.excludeGen9 = true

-- ⚠️ In large clothing packs, there are so many clothes in some categories that it causes this issue where only some clothes are shown or even if you select them, the clothes don't change. If you have such an issue, you can solve it by setting this to false.
-- If false, if the component is not valid, it will still try to change the player's clothes.
config.componentValidCheck = false

--  If true, you can raise your hand by pressing the x key while the menu is open. If you are using a different hand-raising script and the keys conflict, you can disable this feature.
config.handsUpInClothing = true

-- Blurs the background while a clothing menu is open, the character stays sharp
config.bgBlurActive = true

-- Lights the scene while a clothing menu is open, so clothes and tattoos show clearly
config.wardrobeLight = {
    active = true,
    modifier = "DLC_MpSecurity_Stu_Wardrobe", -- timecycle modifier used as the light
    strength = 1.0, -- 0.0 - 1.0
}

config.creatingChar = {
    wait = 4000, -- The time the menu opens after x milliseconds when the createFirstCharacter event is triggered
    showClotheOptions = {
        -- Allow the player to choose clothes when creating a character
        active = false,
        -- If active, a clothing menu will be shown during character creation
        -- clotheList: set a list name (e.g. "global") to limit available clothes, or false for all clothes
        clotheList = false,
    },
    creationCoords = vector4(-795.57, 331.79, 200.42, 270.0), -- Where the player stands during character creation (x, y, z, heading)
    afterCreation = {
        spawnBack = false, -- If true, player spawns back to last location (set true for qb-apartment), if true, spawnCoords becomes invalid
        spawnCoords = vector4(435.99, -644.68, 27.74, 86.23), -- Where the player spawns after character creation
    },
    -- Clothes worn while the creation menu is open
    menuOutfit = {
        [joaat("mp_m_freemode_01")] = {
            components = {
                [1] = { collection = "base", index = 0, texture = 0 }, -- mask
                [3] = { collection = "base", index = 15, texture = 0 }, -- arms
                [4] = { collection = "mp_m_valentines_02", index = 1, texture = 6 }, -- pants
                [5] = { collection = "base", index = 0, texture = 0 }, -- bag
                [6] = { collection = "Male_Apt01", index = 1, texture = 0 }, -- shoes
                [7] = { collection = "base", index = 0, texture = 0 }, -- chain
                [8] = { collection = "base", index = 15, texture = 0 }, -- tshirt
                [9] = { collection = "base", index = 0, texture = 0 }, -- armor
                [10] = { collection = "base", index = 0, texture = 0 }, -- decals
                [11] = { collection = "base", index = 15, texture = 0 }, -- torso
            },
            -- props = {
            --     [0] = { collection = "base", index = -1, texture = 0 }, -- helmet
            --     [1] = { collection = "base", index = -1, texture = 0 }, -- glasses
            --     [2] = { collection = "base", index = -1, texture = 0 }, -- ears
            --     [6] = { collection = "base", index = -1, texture = 0 }, -- watches
            --     [7] = { collection = "base", index = -1, texture = 0 }, -- bracelets
            -- },
        },
        [joaat("mp_f_freemode_01")] = {
            components = {
                [1] = { collection = "base", index = 0, texture = 0 }, -- mask
                [3] = { collection = "base", index = 15, texture = 0 }, -- arms
                [4] = { collection = "Female_freemode_beach", index = 1, texture = 4 }, -- pants
                [5] = { collection = "base", index = 0, texture = 0 }, -- bag
                [6] = { collection = "Female_Apt01", index = 1, texture = 0 }, -- shoes
                [7] = { collection = "base", index = 0, texture = 0 }, -- chain
                [8] = { collection = "base", index = 14, texture = 0 }, -- tshirt
                [9] = { collection = "base", index = 0, texture = 0 }, -- armor
                [10] = { collection = "base", index = 0, texture = 0 }, -- decals
                [11] = { collection = "Female_freemode_beach", index = 2, texture = 4 }, -- torso
            },
            -- props = {
            --     [0] = { collection = "base", index = -1, texture = 0 }, -- helmet
            --     [1] = { collection = "base", index = -1, texture = 0 }, -- glasses
            --     [2] = { collection = "base", index = -1, texture = 0 }, -- ears
            --     [6] = { collection = "base", index = -1, texture = 0 }, -- watches
            --     [7] = { collection = "base", index = -1, texture = 0 }, -- bracelets
            -- },
        },
    },
    -- Clothes worn by default after character creation (ignored if showClotheOptions.active is true)
    -- Same format as menuOutfit: components, props per gender
    initialOutfit = {
        [joaat("mp_m_freemode_01")] = {
            components = {
                [1] = { collection = "base", index = 0, texture = 0 }, -- mask
                [3] = { collection = "base", index = 0, texture = 0 }, -- arms
                [4] = { collection = "base", index = 7, texture = 0 }, -- pants
                [5] = { collection = "base", index = 0, texture = 0 }, -- bag
                [6] = { collection = "base", index = 1, texture = 0 }, -- shoes
                [7] = { collection = "base", index = 0, texture = 0 }, -- chain
                [8] = { collection = "base", index = 15, texture = 0 }, -- tshirt
                [9] = { collection = "base", index = 0, texture = 0 }, -- armor
                [10] = { collection = "base", index = 0, texture = 0 }, -- decals
                [11] = { collection = "Male_freemode_valentines", index = 2, texture = 1 }, -- torso
            },
            -- props = {
            --     [0] = { collection = "base", index = -1, texture = 0 }, -- helmet
            --     [1] = { collection = "base", index = -1, texture = 0 }, -- glasses
            --     [2] = { collection = "base", index = -1, texture = 0 }, -- ears
            --     [6] = { collection = "base", index = -1, texture = 0 }, -- watches
            --     [7] = { collection = "base", index = -1, texture = 0 }, -- bracelets
            -- },
        },
        [joaat("mp_f_freemode_01")] = {
            components = {
                [1] = { collection = "base", index = 0, texture = 0 }, -- mask
                [3] = { collection = "base", index = 3, texture = 0 }, -- arms
                [4] = { collection = "base", index = 0, texture = 10 }, -- pants
                [5] = { collection = "base", index = 0, texture = 0 }, -- bag
                [6] = { collection = "base", index = 3, texture = 0 }, -- shoes
                [7] = { collection = "base", index = 0, texture = 0 }, -- chain
                [8] = { collection = "base", index = 14, texture = 0 }, -- tshirt
                [9] = { collection = "base", index = 0, texture = 0 }, -- armor
                [10] = { collection = "base", index = 0, texture = 0 }, -- decals
                [11] = { collection = "base", index = 3, texture = 2 }, -- torso
            },
            -- props = {
            --     [0] = { collection = "base", index = -1, texture = 0 }, -- helmet
            --     [1] = { collection = "base", index = -1, texture = 0 }, -- glasses
            --     [2] = { collection = "base", index = -1, texture = 0 }, -- ears
            --     [6] = { collection = "base", index = -1, texture = 0 }, -- watches
            --     [7] = { collection = "base", index = -1, texture = 0 }, -- bracelets
            -- },
        },
    },
}

-- Available icons for outfit customization (FontAwesome solid icon names without "fa-" prefix)
config.outfitIcons = {
    "shirt",
    "vest",
    "hat-cowboy",
    "glasses",
    "shoe-prints",
    "mask-face",
    "user-tie",
    "suitcase",
    "star",
    "heart",
    "fire",
    "bolt",
    "crown",
    "gem",
    "shield",
    "skull",
    "ghost",
    "dragon",
    "wand-magic-sparkles",
    "hand-fist",
    "gun",
    "briefcase",
}

-- Available colors for outfit customization
config.outfitColors = {
    "#36ff9f",
    "#ff3636",
    "#3636ff",
    "#ff9336",
    "#b236ff",
    "#36d4ff",
    "#ffff36",
    "#ff36b2",
    "#ffffff",
    "#888888",
}

config.items = {
    -- When you use the item, you can change the skin data saved in the clothe shops.
    -- Clothing only works properly when config.clothingAsItem is false.
    clothing = {
        enable = true,
        itemName = "clothing_changer", -- item name for clothing
        canOpen = {
            damage = {
                active = true, -- If true, the player can't open the menu when damaged or damaging
                time = 300000 -- milisecond (300000 = 5 minutes)
            },
            handWeapon = true -- If true, the player can't open the menu when holding a weapon
        },
        progressbar = {
            active = true,
            label = "wearingClothe", -- u can change from language file
            time = 4300,
            anims = {
                male = {
                    animDict = "anim_heist@hs3f@ig12_change_clothes@",
                    anim = "change_noose_male",
                    flags = 1,
                    deleteProp = false
                },
                female = {
                    animDict = "anim_heist@hs3f@ig12_change_clothes@",
                    anim = "change_noose_female",
                    flags = 1,
                    deleteProp = false
                }
            },
        }
    },
    -- When you use the item, you can change the skin data saved in the barber shops.
    barber = {
        enable = true,
        itemName = "barber_changer", -- item name for barber
        canOpen = {
            damage = {
                active = true, -- If true, the player can't open the menu when damaged or damaging
                time = 300000 -- milisecond (300000 = 5 minutes)
            },
            handWeapon = true -- If true, the player can't open the menu when holding a weapon
        },
        progressbar = {
            active = true,
            label = "changinBarber", -- u can change from language file
            time = 4000,
            anims = {
                male = {
                    animDict = "clothingtie",
                    anim = "try_tie_neutral_d",
                    flags = 1,
                    deleteProp = true
                },
                female = {
                    animDict = "mp_clothing@female@trousers",
                    anim = "try_trousers_neutral_a",
                    flags = 1,
                    deleteProp = false
                }
            },
        }
    },
}

config.refreshSkin = {
    -- Command to refresh the character
    active = true,
    command = { "refreshskin", "yenile" }, -- command name
    eventName = "tgiann-clothing:refreshSkin",
    rate = 2000, -- how many miliseconds after the player uses the command can he use it again
    deleteAttachedObjectWhenUsed = true -- when the player uses the refreshskin command, if there is an object attached to the character, it deletes it (prevents the probe in the hand from falling to the ground in some animations)
}

-- only works on clothing shops
-- https://docs.tgiann.com/scripts/tgiann-clothing/guides/how-to-adjust-clothing-prices
config.clothingPrice = {
    enable = true, -- if true, clothe prices come from the admin panel > Prices tab (data/clothingPrice.json); if false, every clothe costs defaultPrice (a shop with a clothe list uses that list's prices either way)
    defaultPrice = 10,
}

config.berberPrice = {
    enable = true,
    price = 500,
}

config.disableIdleCam = true -- If true it disables the Idle Cam
config.displayRadar = false -- If true it closes the minimap when the clothing menu is opened and opens it again when the clothing menu is closed, if false the minimap is never touched

-- if you are using esx you may need to set this to true or trigger the createFirstCharacter event
-- if you used to use a different clothe script on your server and have an active(If you have old script skin data of old players) server, set this setting to true
-- config.autoOpenCreateMenu = false
-- config.autoOpenCreateMenu = true
config.autoOpenCreateMenu = true -- true | false > When this is true, the creation menu opens when the character load event is triggered and you have no skin data. false when the “createFirstCharacter” event is triggered

config.events = {
    qb = {
        onPlayerLoaded = "QBCore:Client:OnPlayerLoaded",
        createFirstCharacter = "qb-clothes:client:CreateFirstCharacter"
    },
    esx = {
        onPlayerLoaded = "esx:playerLoaded",
        createFirstCharacter = "tgiann-clothing:esx:createNew"
    }
}

-- if clothingAsItem is true it opens an inventory for clothes, if false it opens a menu where you can change your registered clothes
-- Also u can edit OpenWardrobeMenu function from client/editable.lua
config.outfitChangers = {
    { coords = vector3(-32.6164, -1112.1201, 26.4224), maxDistance = 3, pressDistance = 3 },
}

-- Shops (location, zone, blip, clothe list, business) are set in the admin panel > Shops tab (data/stores.json)
-- Draws the shop zones in game while you set them up
config.storeZoneDebug = false

config.blips = {
    clothing = {
        activeAfterLogin = true, -- If true, clothingshop blips will automatically turn on when player joins game
        event = "tgiann-clothing:clothing:blip:onOff", -- You can use this event to toggle the blips
        sprite = 73,
        color = 46,
        scale = 0.5
    },
    barber = {
        activeAfterLogin = true, -- If true, Barber blips will automatically turn on when player joins game
        event = "tgiann-clothing:barber:blip:onOff", -- You can use this event to toggle the blips
        sprite = 71,
        color = 51,
        scale = 0.5
    },
    tattoo = {
        activeAfterLogin = true, -- If true, Tattoo blips will automatically turn on when player joins game
        event = "tgiann-clothing:tattoo:blip:onOff", -- You can use this event to toggle the blips
        sprite = 75,
        color = 1,
        scale = 0.5
    },
}

-- Command for players to tie up hair
config.hairClips = {
    enable = true,
    command = { "hair", "toka" }, -- Command name
    male = { collection = "base", index = 4 }, -- Default hair (collection format)
    female = { collection = "mp_f_gunrunning_hair_01", index = 7 }, -- Default hair (collection format)
}

-- Naked/unwear default clothes
config.naked = {
    [joaat("mp_m_freemode_01")] = {
        components = {
            [1] = { collection = "base", index = 0, texture = 0 }, -- mask
            [3] = { collection = "base", index = 15, texture = 0 }, -- arms
            [4] = { collection = "mp_m_valentines_02", index = 1, texture = { 1, 2, 3, 4, 5, 6 } }, -- pants
            [5] = { collection = "base", index = 0, texture = 0 }, -- bag
            [6] = { collection = "Male_Apt01", index = 1, texture = 0 }, -- shoes
            [7] = { collection = "base", index = 0, texture = 0 }, -- chain
            [8] = { collection = "base", index = 15, texture = 0 }, -- tshirt
            [9] = { collection = "base", index = 0, texture = 0 }, -- armor
            [10] = { collection = "base", index = 0, texture = 0 }, -- decals
            [11] = { collection = "base", index = 15, texture = 0 }, -- torso
        },
        props = {
            [0] = { collection = "base", index = -1, texture = 0 }, -- helmet
            [1] = { collection = "base", index = -1, texture = 0 }, -- glasses
            [2] = { collection = "base", index = -1, texture = 0 }, -- ears
            [6] = { collection = "base", index = -1, texture = 0 }, -- watches
            [7] = { collection = "base", index = -1, texture = 0 }, -- bracelets
        }
    },
    [joaat("mp_f_freemode_01")] = {
        components = {
            [1] = { collection = "base", index = 0, texture = 0 }, -- mask
            [3] = { collection = "base", index = 15, texture = 0 }, -- arms
            [4] = { collection = "Female_freemode_beach", index = 1, texture = 4 }, -- pants
            [5] = { collection = "base", index = 0, texture = 0 }, -- bag
            [6] = { collection = "Female_Apt01", index = 1, texture = 0 }, -- shoes
            [7] = { collection = "base", index = 0, texture = 0 }, -- chain
            [8] = { collection = "base", index = 14, texture = 0 }, -- tshirt
            [9] = { collection = "base", index = 0, texture = 0 }, -- armor
            [10] = { collection = "base", index = 0, texture = 0 }, -- decals
            [11] = { collection = "Female_freemode_beach", index = 2, texture = 4 }, -- torso
        },
        props = {
            [0] = { collection = "base", index = -1, texture = 0 }, -- helmet
            [1] = { collection = "base", index = -1, texture = 0 }, -- glasses
            [2] = { collection = "base", index = -1, texture = 0 }, -- ears
            [6] = { collection = "base", index = -1, texture = 0 }, -- watches
            [7] = { collection = "base", index = -1, texture = 0 }, -- bracelets
        }
    }
}

-- bottom left animations in the menu
config.defaultAnimation = { dict = 'anim@amb@clubhouse@mini@darts@', name = 'wait_idle' }
config.animations = {
    {
        img = "anim_2",
        anim = {
            dict = "airforce@attention",
            name = "base"
        }
    },
    {
        img = "anim_4",
        anim = {
            dict = "anim@mp_corona_idles@female_b@idle_a",
            name = "idle_a"
        }
    },
    {
        img = "anim_1",
        anim = {
            dict = "rcmnigel1a",
            name = "base"
        }
    },
    {
        img = "anim_3",
        anim = {
            dict = "random@shop_tattoo",
            name = "_idle_a"
        }
    },
}

-- Which skin data categories to save per wardrobe type
-- Each category is optional. Only include the ones you want to save.
--
-- Available categories:
--   pedModel = true                          -- Save ped model hash
--   eyeColor = true                          -- Save eye color index
--   components = { 1, 2, ... }               -- Component IDs: 1=Mask, 2=Hair, 3=Arms, 4=Pants, 5=Bag, 6=Shoes, 7=Chain, 8=T-Shirt, 9=Armor, 10=Decals, 11=Torso
--   props = { 0, 1, ... }                    -- Prop IDs: 0=Helmet, 1=Glasses, 2=Ears, 6=Watches, 7=Bracelets
--   headBlend = { "shapeFirst", ... }        -- Fields: "shapeFirst", "shapeSecond", "skinFirst", "skinSecond", "shapeMix", "skinMix"
--   faceFeatures = { 0, 1, ... }             -- IDs 0-19: 0=NoseWidth, 1=NosePeakHeight, 2=NosePeakLength, 3=NoseBoneHeight, 4=NosePeakLowering, 5=NoseBoneTwist, 6=EyeBrowHeight, 7=EyeBrowLength, 8=CheekBoneHeight
--                                               9=CheekBoneWidth, 10=CheekWidth, 11=EyeOpenings, 12=LipThickness, 13=JawBoneWidth, 14=JawBoneLength, 15=ChinBoneHeight, 16=ChinBoneLength, 17=ChinBoneWidth, 18=ChinDimple, 19=NeckWidth
--   headOverlays = { 0, 1, ... }             -- IDs 0-12: 0=Blemishes, 1=Beard, 2=Eyebrows, 3=Age, 4=Makeup, 5=Blush, 6=Complexion, 7=SunDamage, 8=Lipstick, 9=Moles, 10=ChestHair, 11=BodyBlemish, 12=BodyBlemish2
--   hair = { "color1", "color2", "overlay" } -- Hair fields: "color1", "color2", "overlay"
config.warDropSaveData = {
    clothing = {
        components = { 1, 3, 4, 5, 6, 7, 8, 9, 10, 11 },
        props = { 0, 1, 2, 6, 7 },
    },
    barber = {
        components = { 2 }, -- hair
        headOverlays = { 1, 2, 4, 5, 6, 7, 8, 10 }, -- beard, eyebrows, makeup, blush, complexion, sunDamage, lipstick, chestHair
        hair = { "color1", "color2", "overlay" },
        faceFeatures = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 },
    },
}

--- Read and decode a JSON file
---@param path string File path relative to resource root (e.g. "data/blacklist.json")
---@return table|nil data Decoded table, nil if file doesn't exist or parse fails
function LoadJson(path)
    local file = LoadResourceFile(cache.resource, path)
    if not file then return nil end
    local success, data = pcall(json.decode, file)
    if not success then
        print(("^1[tgiann-clothing] JSON parse error: %s | %s^7"):format(path, tostring(data)))
        return nil
    end
    return data
end

-- How a joining player gets the admin panel data (shops, prices, clothe lists, hidden clothes, armor, masks, collection order)
-- true: the player asks the server on join and gets one snapshot. Always up to date, costs some network on every join.
-- false: the player reads the data/*.json files that come with the resource. No network on join, but the files only
--        refresh on a resource restart, so players who join after an admin edit see the old data until the next restart.
-- In both modes every admin panel edit reaches the online players at once.
config.clothingLoadDataFromServer = false

config.debug = false

Last updated