Cadburry ScriptsCadburry Scripts

Appearance

Quality of life scripts for your FiveM server. Performance optimized resources that install in minutes, with free updates and support that actually answers.

config/appearance.lua

lua
Config = Config or {}

---Built in appearance.
Config.Appearance = {
    ---Enable/Disable appearance.
    enabled = true,

    ---Open the editor automatically right after a character is created.
    onCharacterCreate = true,

    ---Command that opens the editor anywhere (set to false to disable).
    command = 'clothing',

    ---Restrict the command to players with this ace permission (false = everyone).
    commandAce = true,

    ---Fade the screen while the ped model is swapped (avoids the naked-ped flash).
    automaticFade = true,

    ---Charge the player when they use a shop zone (0 = free). Uses the inventory bridge.
    prices = {
        clothing = 0,
        barber = 0,
        tattoo = 0,
        surgeon = 0,
    },

    ---How many outfits a single character may store.
    maxOutfits = 20,

    ---Sections available in each context.
    ---`creation` = new character flow, `clothing`/`barber`/`tattoo`/`surgeon` = shop zones.
    sections = {
        creation = { ped = true, headBlend = true, faceFeatures = true, headOverlays = true, hair = true, components = true, props = true, tattoos = false, outfits = false },
        clothing = { ped = false, headBlend = false, faceFeatures = false, headOverlays = false, hair = false, components = true, props = true, tattoos = false, outfits = true },
        barber   = { ped = false, headBlend = false, faceFeatures = false, headOverlays = true, hair = true, components = false, props = false, tattoos = false, outfits = false },
        tattoo   = { ped = false, headBlend = false, faceFeatures = false, headOverlays = false, hair = false, components = false, props = false, tattoos = true, outfits = false },
        surgeon  = { ped = false, headBlend = true, faceFeatures = true, headOverlays = false, hair = false, components = false, props = false, tattoos = false, outfits = false },
        admin    = { ped = true, headBlend = true, faceFeatures = true, headOverlays = true, hair = true, components = true, props = true, tattoos = true, outfits = true },
    },

    ---Ped models the player may switch to in the editor.
    ---Only freemode models support head blending / face features; others are "story" peds.
    models = {
        { model = 'mp_m_freemode_01', label = 'Male' },
        { model = 'mp_f_freemode_01', label = 'Female' },
    },

    ---Clothing the ped starts with when creating a brand new character.
    initialClothes = {
        ['mp_m_freemode_01'] = {
            components = {
                { component_id = 0,  drawable = 0,  texture = 0 },
                { component_id = 1,  drawable = 0,  texture = 0 },
                { component_id = 2,  drawable = 0,  texture = 0 },
                { component_id = 3,  drawable = 15, texture = 0 },
                { component_id = 4,  drawable = 21, texture = 0 },
                { component_id = 5,  drawable = 0,  texture = 0 },
                { component_id = 6,  drawable = 34, texture = 0 },
                { component_id = 7,  drawable = 0,  texture = 0 },
                { component_id = 8,  drawable = 15, texture = 0 },
                { component_id = 9,  drawable = 0,  texture = 0 },
                { component_id = 10, drawable = 0,  texture = 0 },
                { component_id = 11, drawable = 15, texture = 0 },
            },
            props = {
                { prop_id = 0, drawable = -1, texture = 0 },
                { prop_id = 1, drawable = -1, texture = 0 },
                { prop_id = 2, drawable = -1, texture = 0 },
                { prop_id = 6, drawable = -1, texture = 0 },
                { prop_id = 7, drawable = -1, texture = 0 },
            },
            hair = { style = 0, color = 0, highlight = 0 },
        },
        ['mp_f_freemode_01'] = {
            components = {
                { component_id = 0,  drawable = 0,  texture = 0 },
                { component_id = 1,  drawable = 0,  texture = 0 },
                { component_id = 2,  drawable = 0,  texture = 0 },
                { component_id = 3,  drawable = 15, texture = 0 },
                { component_id = 4,  drawable = 10, texture = 0 },
                { component_id = 5,  drawable = 0,  texture = 0 },
                { component_id = 6,  drawable = 35, texture = 0 },
                { component_id = 7,  drawable = 0,  texture = 0 },
                { component_id = 8,  drawable = 15, texture = 0 },
                { component_id = 9,  drawable = 0,  texture = 0 },
                { component_id = 10, drawable = 0,  texture = 0 },
                { component_id = 11, drawable = 15, texture = 0 },
            },
            props = {
                { prop_id = 0, drawable = -1, texture = 0 },
                { prop_id = 1, drawable = -1, texture = 0 },
                { prop_id = 2, drawable = -1, texture = 0 },
                { prop_id = 6, drawable = -1, texture = 0 },
                { prop_id = 7, drawable = -1, texture = 0 },
            },
            hair = { style = 0, color = 0, highlight = 0 },
        },
    },

    ---Hide individual clothing slots from the UI entirely.
    disabledComponents = {
        [1] = false,  -- Mask
        [3] = false,  -- Arms / Hands
        [4] = false,  -- Legs
        [5] = false,  -- Bag
        [6] = false,  -- Shoes
        [7] = false,  -- Accessories
        [8] = false,  -- Undershirt
        [9] = false,  -- Body armor. Shown: it is saved with the appearance either way,
                      -- so hiding the picker meant armor could be put on but never taken off.
        [10] = false, -- Decals
        [11] = false, -- Tops
    },

    disabledProps = {
        [0] = false, -- Hat
        [1] = false, -- Glasses
        [2] = false, -- Ear
        [6] = false, -- Watch
        [7] = false, -- Bracelet
    },

    ---Camera framing per editor tab. offset is relative to the ped bone.
    ---fov: lower = tighter shot.
    cameras = {
        default = { bone = 0,     offset = { x = 0.0, y = 2.2,  z = 0.2  }, fov = 45.0 },
        head    = { bone = 31086, offset = { x = 0.0, y = 0.75, z = 0.0  }, fov = 22.0 },
        torso   = { bone = 24816, offset = { x = 0.0, y = 1.35, z = 0.05 }, fov = 32.0 },
        legs    = { bone = 51826, offset = { x = 0.0, y = 1.5,  z = 0.1  }, fov = 38.0 },
        feet    = { bone = 14201, offset = { x = 0.0, y = 1.0,  z = 0.1  }, fov = 32.0 },
        ---Waist to soles in one frame, for judging trousers and shoes together.
        ---Anchored to the ped origin (bone 0) rather than a leg bone: leg bones move
        ---with the idle animation, which made the framing drift shot to shot.
        ---A ped is ~1.0m from origin to ground, so -0.55 centres the lower half, and
        ---fov 36 at 1.8m covers ~1.1m of height -- the whole span plus margin.
        lower   = { bone = 0,     offset = { x = 0.0, y = 1.8,  z = -0.55 }, fov = 36.0 },
    },

    ---Holds the ped still while the editor is open.
    ---FreezeEntityPosition locks position and heading but NOT the skeleton: a freemode
    ---ped keeps playing its base idle (breathing, weight shifts), so the preview drifts
    ---while you are trying to judge a garment, and the bone-anchored cameras wander with
    ---it. Playing a standing clip and pinning its speed to 0 holds a single frame.
    ---Set enabled = false to keep the ped's normal idle animation.
    freezePose = {
        enabled = true,
        dict = 'amb@world_human_stand_impatient@male@no_sign@base',
        clip = 'base',
    },

    ---Thumbnail previews shown in the editor instead of plain numbers.
    previews = {
        enabled = true,
        folder = 'preview',
        ext = 'png',
        ---Shown when a drawable has no photo yet, relative to `folder`.
        ---Set to false to fall back to a plain numbered tile instead.
        defaultImage = 'default.png',
    },

    ---Manual camera framing offered in the editor footer. `normal` follows the active tab;
    ---the others pin the camera until the player picks a different one.
    camPositions = {
        { id = 'normal', label = 'Normal' },
        { id = 'top',    label = 'Top',    camera = 'head' },
        { id = 'center', label = 'Center', camera = 'torso' },
        { id = 'bottom', label = 'Bottom', camera = 'lower' },
    },

    ---Which camera each UI tab uses.
    tabCameras = {
        ped = 'default',
        heritage = 'head',
        features = 'head',
        appearance = 'head',
        clothing = 'default',
        accessories = 'head',
        tattoos = 'default',
        outfits = 'default',
    },

    ---Shop zones. Each entry spawns a blip + interaction point.
    ---`type` selects which section set from Config.Appearance.sections is used.
    zones = {
        {
            type = 'clothing',
            label = 'Clothing Store',
            blip = { sprite = 73, color = 47, scale = 0.7 },
            points = {
                vector3(72.3, -1399.1, 29.4),
                vector3(-703.8, -152.3, 37.4),
                vector3(-167.9, -299.0, 39.7),
                vector3(428.7, -800.1, 29.5),
                vector3(-829.4, -1073.7, 11.3),
                vector3(-1447.8, -242.5, 49.8),
                vector3(11.6, 6514.2, 31.9),
                vector3(123.6, -219.4, 54.6),
                vector3(1696.3, 4829.3, 42.1),
                vector3(618.1, 2759.6, 42.1),
                vector3(1190.5, 2713.4, 38.2),
                vector3(-1193.4, -772.3, 17.3),
                vector3(-3172.5, 1048.1, 20.9),
            },
        },
        {
            type = 'barber',
            label = 'Barber Shop',
            blip = { sprite = 71, color = 0, scale = 0.7 },
            points = {
                vector3(136.8, -1708.4, 29.3),
                vector3(-278.1, 6228.5, 31.7),
                vector3(1931.5, 3729.7, 32.8),
                vector3(1212.8, -472.9, 66.2),
                vector3(-32.9, -152.3, 57.1),
                vector3(-1282.6, -1116.8, 7.0),
                vector3(1655.1, 4830.5, 42.0),
                vector3(-1153.6, -1425.6, 4.9),
            },
        },
        {
            type = 'tattoo',
            label = 'Tattoo Parlor',
            blip = { sprite = 75, color = 4, scale = 0.7 },
            points = {
                vector3(322.1, 180.5, 103.6),
                vector3(-1153.6, -1425.6, 4.9),
                vector3(1322.6, -1651.9, 52.3),
                vector3(-3170.0, 1075.0, 20.8),
                vector3(1864.6, 3747.7, 33.0),
                vector3(-293.7, 6200.0, 31.5),
            },
        },
        {
            type = 'surgeon',
            label = 'Plastic Surgeon',
            blip = false,
            points = {},
        },
    },

    ---Interaction distance for shop zones + which key opens them.
    zoneDistance = 1.6,
    zoneKey = 38, -- INPUT_CONTEXT (E)
}

---Clothing component slots.
---Component slots the randomizer is allowed to leave empty (drawable 0 = nothing worn).
---Body armor is listed because it is gameplay equipment, not an outfit choice.
Config.AppearanceOptionalComponents = { [1] = true, [5] = true, [7] = true, [9] = true, [10] = true }

Config.AppearanceComponents = {
    { id = 11, label = 'Tops',        camera = 'torso' },
    { id = 8,  label = 'Undershirt',  camera = 'torso' },
    { id = 3,  label = 'Hands',       camera = 'torso' },
    { id = 10, label = 'Decals',      camera = 'torso' },
    { id = 4,  label = 'Legs',        camera = 'legs'  },
    { id = 6,  label = 'Shoes',       camera = 'feet'  },
    { id = 5,  label = 'Bag',         camera = 'default' },
    { id = 7,  label = 'Accessories', camera = 'torso' },
    { id = 1,  label = 'Mask',        camera = 'head'  },
    { id = 9,  label = 'Body Armor',  camera = 'torso' },
}

---Prop slots. `id` is the GTA prop id.
Config.AppearanceProps = {
    { id = 0, label = 'Hat',      camera = 'head' },
    { id = 1, label = 'Glasses',  camera = 'head' },
    { id = 2, label = 'Earrings', camera = 'head' },
    { id = 6, label = 'Watch',    camera = 'torso' },
    { id = 7, label = 'Bracelet', camera = 'torso' },
}

---Face feature sliders. Index matches the native's index argument (0-19).
Config.AppearanceFaceFeatures = {
    { index = 0,  label = 'Nose Width' },
    { index = 1,  label = 'Nose Peak Height' },
    { index = 2,  label = 'Nose Peak Length' },
    { index = 3,  label = 'Nose Bone Height' },
    { index = 4,  label = 'Nose Peak Lowering' },
    { index = 5,  label = 'Nose Bone Twist' },
    { index = 6,  label = 'Eyebrow Height' },
    { index = 7,  label = 'Eyebrow Depth' },
    { index = 8,  label = 'Cheekbone Height' },
    { index = 9,  label = 'Cheekbone Width' },
    { index = 10, label = 'Cheek Width' },
    { index = 11, label = 'Eye Opening' },
    { index = 12, label = 'Lip Thickness' },
    { index = 13, label = 'Jaw Bone Width' },
    { index = 14, label = 'Jaw Bone Length' },
    { index = 15, label = 'Chin Height' },
    { index = 16, label = 'Chin Length' },
    { index = 17, label = 'Chin Width' },
    { index = 18, label = 'Chin Hole Size' },
    { index = 19, label = 'Neck Thickness' },
}

---Head overlays. `index` matches SetPedHeadOverlay's overlayID.
---`colorType`: 0 = no color, 1 = hair palette (blemishes/beard/eyebrows/chest hair),
---2 = makeup palette (blush/lipstick/makeup).
Config.AppearanceHeadOverlays = {
    { index = 0,  id = 'blemishes',       label = 'Blemishes',    colorType = 0 },
    { index = 1,  id = 'beard',           label = 'Facial Hair',  colorType = 1 },
    { index = 2,  id = 'eyebrows',        label = 'Eyebrows',     colorType = 1 },
    { index = 3,  id = 'ageing',          label = 'Ageing',       colorType = 0 },
    { index = 4,  id = 'makeup',          label = 'Makeup',       colorType = 2 },
    { index = 5,  id = 'blush',           label = 'Blush',        colorType = 2 },
    { index = 6,  id = 'complexion',      label = 'Complexion',   colorType = 0 },
    { index = 7,  id = 'sunDamage',       label = 'Sun Damage',   colorType = 0 },
    { index = 8,  id = 'lipstick',        label = 'Lipstick',     colorType = 2 },
    { index = 9,  id = 'moleAndFreckles', label = 'Freckles',     colorType = 0 },
    { index = 10, id = 'chestHair',       label = 'Chest Hair',   colorType = 1 },
    { index = 11, id = 'bodyBlemishes',   label = 'Body Blemish', colorType = 0 },
}

---Heritage parent faces. Indices are the shape/skin ids accepted by SetPedHeadBlendData.
Config.AppearanceParents = {
    male = {
        'Benjamin', 'Daniel', 'Joshua', 'Noah', 'Andrew', 'Joan', 'Alex', 'Isaac', 'Evan', 'Ethan',
        'Vincent', 'Angel', 'Diego', 'Adrian', 'Gabriel', 'Michael', 'Santiago', 'Kevin', 'Louis', 'Samuel', 'Anthony',
    },
    female = {
        'Hannah', 'Audrey', 'Jasmine', 'Giselle', 'Amelia', 'Isabella', 'Zoe', 'Ava', 'Camila', 'Violet',
        'Sophia', 'Evelyn', 'Nicole', 'Ashley', 'Grace', 'Brianna', 'Natalie', 'Olivia', 'Elizabeth', 'Charlotte', 'Emma',
    },
    ---Special parents appended after the 21 base faces (ids 21-45 in game order).
    special = {
        'Claude', 'Niko', 'John', 'Misty',
    },
}

---Drawables the player may never select, keyed by gender then by component/prop id.
---Example: components = { [11] = { 5, 12 } } hides tops 5 and 12.
Config.AppearanceBlacklist = {
    male = {
        hair = {},
        components = {},
        props = {},
    },
    female = {
        hair = {},
        components = {},
        props = {},
    },
}

---Tattoo zones shown as tabs in the tattoo section.
Config.AppearanceTattooZones = {
    { id = 'ZONE_HEAD',      label = 'Head' },
    { id = 'ZONE_TORSO',     label = 'Torso' },
    { id = 'ZONE_LEFT_ARM',  label = 'Left Arm' },
    { id = 'ZONE_RIGHT_ARM', label = 'Right Arm' },
    { id = 'ZONE_LEFT_LEG',  label = 'Left Leg' },
    { id = 'ZONE_RIGHT_LEG', label = 'Right Leg' },
}
Last updated Cadburry Scripts