Client Exports
Menu
OpenMenu
Opens the appearance menu for the player, or for options.ped.
---@class MenuOptions
---@field ped? number # Edit this ped instead of the player. Its model stays unchanged
---@field peds? boolean # Show the ped list next to the gender options. Defaults to true
---@field tabs? MenuOptionsTabs # Defaults to every tab
---@field customTabs? boolean | table<string, boolean | table<string, boolean>> # The custom tabs to show, by the same rule as tabs
---@field free? boolean # Nothing in the menu costs money
---@field canExit? boolean # Whether the player can close the menu without saving. Defaults to true
---@field closeOnEscape? boolean # Whether ESC asks to close the menu. Defaults to true
---@field closeOnSave? boolean # Defaults to true
---@field persistAppearance? boolean # Whether saving in the menu saves the player's appearance. Defaults to true
---@field openInstantly? boolean # Open without the menu fade and the camera ease
---@field disableCamera? boolean
---@field disableLights? boolean
---@field clearTasks? boolean # Clear the ped's tasks when the menu opens and closes. Defaults to true
---@param options? MenuOptions
---@param onClose? fun(appearance?: Appearance) # Called when the menu closes, with the appearance if it was saved
---@return boolean opened
local opened = exports["lb-appearance"]:OpenMenu(options, onClose)tabs sets which tabs and categories are shown. true shows a tab with all its categories, false hides it, and a table of category ids picks its categories.
- A table that sets anything to
trueshows only what it sets totrue - A table that only sets
falseshows everything apart from those
---@class MenuOptionsTabs
---@field appearance? boolean | table<string, boolean> # general, skin, nose, eyes, cheeks, mouth, jaw, ageing, savedAppearances
---@field clothes? boolean | table<string, boolean> # masks, undershirts, torso, gloves, parachute, pants, shoes, accessory, kevlar, badge
---@field hair? boolean | table<string, boolean> # hair, fade, beard, chestHair, eyebrows, makeup
---@field tattoos? boolean | table<string, boolean> # torso, head, leftArm, rightArm, leftLeg, rightLeg
---@field accessories? boolean | table<string, boolean> # hats, glasses, ears, mouth, leftHand, rightHand, watches, bracelets, hip, leftFoot, rightFoot, phLeftHand, phRightHand
---@field outfits? booleanFor example, open a free menu with only the hair tab and the masks category:
exports["lb-appearance"]:OpenMenu({
free = true,
tabs = {
hair = true,
clothes = { masks = true }
}
}, function(appearance)
if appearance then
print("The player saved their appearance")
end
end)CloseMenu
Closes the menu and undoes the changes that weren’t saved. It fails while the menu is busy, such as while checking out.
---@return boolean closed
local closed = exports["lb-appearance"]:CloseMenu()IsMenuOpen
---@return boolean
local isOpen = exports["lb-appearance"]:IsMenuOpen()OpenStore
Opens a store’s menu where the player stands. store is the id of a store from the admin menu, to use its menu options, or a category for that category’s default menu.
---@param store "clothing" | "barber" | "masks" | "tattoo" | number
---@param options? MenuOptions # Merged over the store's menu options
---@param onClose? fun(appearance?: Appearance) # Called when the menu closes, with the appearance if it was saved
---@return boolean opened
local opened = exports["lb-appearance"]:OpenStore(store, options, onClose)OpenWardrobe
Opens the player’s saved outfits.
---@param onClose? fun(appearance?: Appearance) # Called when the menu closes, with the appearance if the player confirmed
---@return boolean opened
local opened = exports["lb-appearance"]:OpenWardrobe(onClose)OpenLockerRoom
Opens a locker room’s outfits wherever the player is. The player needs the locker room’s job and grade, and must be on duty if Config.Lockers.RequireDuty is enabled.
---@param id number # The locker room's id in the admin menu
---@param onClose? fun(appearance?: Appearance) # Called when the menu closes, with the appearance if the player confirmed
---@return boolean opened
local opened = exports["lb-appearance"]:OpenLockerRoom(id, onClose)Appearance
GetAppearance
Returns what the player or a ped wears. Clothes that the player has taken off count as worn, and are listed in hidden.
---@class Component
---@field collection string
---@field drawableId number # The drawable's index in its collection
---@field textureId number
---@field paletteId number
---@class Prop
---@field collection string
---@field drawableId number # The drawable's index in its collection
---@field textureId number
---@class HeadBlendData
---@field shapeFirst integer
---@field shapeSecond integer
---@field shapeThird integer
---@field skinFirst integer
---@field skinSecond integer
---@field skinThird integer
---@field shapeMix number
---@field skinMix number
---@field thirdMix number
---@class HeadOverlay
---@field overlay number | false
---@field colorType number
---@field firstColor number
---@field secondaryColor number
---@field opacity number
---@class PhysicalAppearance
---@field headBlend HeadBlendData
---@field faceFeatures table<number, number>
---@field headOverlays table<number, HeadOverlay>
---@field eyeColor number
---@alias RemovableClothing "hat" | "glasses" | "earrings" | "watch" | "bracelet" | "mask" | "gloves" | "pants" | "bag" | "shoes" | "accessory" | "undershirt" | "kevlar" | "decal" | "top"
---@class Appearance
---@field gender "male" | "female"
---@field model number
---@field physicalAppearance PhysicalAppearance
---@field components table<number, Component> # By component id
---@field props table<number, Prop> # By prop id
---@field tattoos [number, number][] # Collection and overlay hashes
---@field hairColor { primary: number, secondary: number }
---@field hidden? table<RemovableClothing, boolean>
---@field attachments? table
---@param ped? number # Defaults to the player
---@return Appearance
local appearance = exports["lb-appearance"]:GetAppearance(ped)SetAppearance
Applies an appearance to the player or a ped. A ped keeps its model, so the appearance must be for that model. The appearance isn’t saved, and the player can’t be changed while their menu is open.
---@param appearance Appearance
---@param ped? number # Defaults to the player
---@return boolean applied
local applied = exports["lb-appearance"]:SetAppearance(appearance, ped)SetClothes
Puts on the components and props of an outfit or appearance. Props that aren’t in clothes.props are taken off. The player can’t be changed while their menu is open.
---@class Clothes
---@field components table<number, Component>
---@field props table<number, Prop>
---@param clothes Clothes
---@param ped? number # Defaults to the player
---@return boolean applied
local applied = exports["lb-appearance"]:SetClothes(clothes, ped)SaveAppearance
Saves what the player wears as their appearance. It fails while the menu is open, and before the player’s saved appearance has loaded.
---@return boolean saved
local saved = exports["lb-appearance"]:SaveAppearance()ReloadAppearance
Changes the player back into their saved appearance.
---@return boolean reloaded
local reloaded = exports["lb-appearance"]:ReloadAppearance()IsAppearanceLoaded
Returns whether the player’s saved appearance has been applied since they logged in.
---@return boolean
local isLoaded = exports["lb-appearance"]:IsAppearanceLoaded()Outfits
GetOutfits
Returns the player’s saved outfits, or false if they couldn’t be loaded.
---@class OutfitAppearance
---@field model number
---@field components table<number, Component>
---@field props table<number, Prop>
---@field attachments? table
---@class Outfit : OutfitAppearance
---@field id number
---@field label string
---@field photo? string
---@return Outfit[] | false
local outfits = exports["lb-appearance"]:GetOutfits()AddOutfit
Saves an outfit for the player. Without outfit, it saves what the player wears. The head and the hair aren’t saved.
---@param label string # At most 100 characters
---@param outfit? OutfitAppearance | Appearance
---@return Outfit | false
local outfit = exports["lb-appearance"]:AddOutfit(label, outfit)DeleteOutfit
---@param id number
---@return boolean deleted
local deleted = exports["lb-appearance"]:DeleteOutfit(id)OpenOutfitsMenu
Opens the outfits menu with your own list of outfits. The player changes into an outfit for free, and it isn’t saved as their appearance.
---@class ListedOutfit : OutfitAppearance
---@field label string
---@field photo? string
---@class OpenOutfitsMenuOptions
---@field personalOutfits? boolean # Also list the player's saved outfits
---@param outfits ListedOutfit[]
---@param options? OpenOutfitsMenuOptions
---@param onClose? fun(appearance?: Appearance) # Called when the menu closes, with the appearance if the player confirmed
---@return boolean opened
local opened = exports["lb-appearance"]:OpenOutfitsMenu(outfits, options, onClose)Clothing
These exports take off and put back single pieces of clothing. They play the clothing animation, and fail while the menu is open.
RemoveClothing
---@param name RemovableClothing
---@return boolean success
---@return "NOT_WEARING" | nil error
local success, error = exports["lb-appearance"]:RemoveClothing(name)RestoreClothing
---@param name RemovableClothing
---@return boolean success
---@return "GLOVES_DONT_FIT" | nil error
local success, error = exports["lb-appearance"]:RestoreClothing(name)ToggleClothing
---@param name RemovableClothing
---@return boolean success
---@return "NOT_WEARING" | "GLOVES_DONT_FIT" | nil error
local success, error = exports["lb-appearance"]:ToggleClothing(name)IsClothingRemoved
---@param name RemovableClothing
---@return boolean
local isRemoved = exports["lb-appearance"]:IsClothingRemoved(name)