Skip to content

👔 Colorways ​

Documentation relating to the jo_clothingstore_colorways add-on for Clothing store script.

1. Installation ​

WARNING

Clothing store script is required to use this add-on

To install jo_clothingstore_colorways:

  • Drag and drop the resource into your resources folder
    • jo_clothingstore_colorways
  • Add this ensure in your server.cfg after ensure jo_clothingstore
    • ensure jo_clothingstore_colorways

Congratulation, the Colorways add-on is ready to be used!

2. Usage ​

  • Go in a clothing store and press Config.keys.colorways (default : C) to open the colorways menu
  • New color variations will be added to the current item variations slider

3. Configuration ​

The configuration files are located in the config folder within the resource. This folder contains two subfolders:

  • _default.lock/ - Contains the default configuration files. Do not edit these files directly as they may be overwritten during updates.
  • custom/ - This is where you place your custom configuration files to override the defaults.

How to customize the configuration ​

  1. Navigate to jo_clothingstore_colorways/config/_default.lock/
  2. Copy the file you want to modify (e.g., prices.lua )
  3. Paste it into jo_clothingstore_colorways/config/custom/
  4. Edit the copied file in the custom folder

The script automatically loads files from custom/ first, and only uses _default.lock/ as a fallback. This system ensures your customizations are preserved when updating the script.

Default configuration files ​

Loading configuration...

Palette Configuration ​

Config.palettes controls which palettes are visible in the menu and which tint values can be selected for each palette.

Supported options per palette:

  • enabled: show or hide the palette in the menu
  • disabledTints: tint indices that cannot be selected
  • min: lowest allowed tint index
  • max: highest allowed tint index

Example:

lua
Config.palettes = {
  tint_generic_clean = { enabled = true, min = 0, max = 31 },
  tint_hair = { enabled = true, disabledTints = { 1, 2, 3 }, min = 0, max = 25 },
  tint_makeup = { enabled = true, disabledTints = { 33, 34, 35, 36, 37, 38 } },
  tint_horse = { enabled = false }
}

These restrictions are applied to the tint sliders for the selected palette.

Language Configuration ​

The script supports full translation through the language system. To override any text:

  1. Find the key you want to change in config/_default.lock/lang.lua
  2. Copy lang.lua to config/custom/ and add only the keys you want to override

Example:

lua
Lang.colorways = "Цветовая гамма"
Lang.customColor = "Пользовательский цвет"
Lang.noPalette = "Вы не можете получить доступ к цветовой гамме"

Available translation categories include:

  • General UI & Common Terms
  • Palettes names

Only change the key you need to translate

You only need to include the specific keys you want to change in config/custom/lang.lua. Don't copy the entire language file if you don't need to.

4. For developers ​

Actions ​

Actions are one of the two types of Hooks. They provide a way for running a function at a specific point in the execution of scripts. Callback functions for an Action do not return anything back to the calling Action hook. They are the counterpart to Filters.

Below is a complete list of all available actions in the jo_clothingstore script.

Client init ​

Triggered when the addon is initialized

lua
exports.jo_clothingstore_colorways:registerAction('init', function()
    -- Your code here
end)

Filters ​

Filters allow you to modify data or permissions synchronously at specific points in the script. Below is the complete list of jo_clothingstore filters and how to use them.

Client canOpenColorPalette ​

Manage who can open the custom color menu

lua
-- @param canAccess - boolean
exports.jo_clothingstore_colorways:registerFilter('canOpenColorPalette', function(canAccess)
  --return false to disable the access of the menu
  return canAccess
end)

Client paletteValues ​

Manage the values of the palettes

lua
-- @param values - table
exports.jo_clothingstore_colorways:registerFilter('paletteValues', function(values)
  -- manipulates values to add/remove/replace data and return new palettes values
  return values
end)

Client updateHashpreviewBeforeBuy ​

Update hash preview before buying

lua
-- @param hashpreview - table
-- @param currentData - table
exports.jo_clothingstore_colorways:registerFilter('updateHashpreviewBeforeBuy', function(hashpreview,currentData)
  return hashpreview
end)

Last updated: