Skip to content

✂️ Hair & Beard Coloring ​

Documentation relating to the jo_hairdresser_coloring add-on for the Hairdresser script.

1. Installation ​

WARNING

The Hairdresser script is required to use this add-on.

To install jo_hairdresser_coloring:

  • Drag and drop the resource into your resources folder
    • jo_hairdresser_coloring
  • Add this ensure to your server.cfg after ensure jo_hairdresser
    • ensure jo_hairdresser_coloring

Congratulations, the Hair & Beard Coloring add-on is ready to use!

2. Usage ​

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_hairdresser_coloring/config/_default.lock/
  2. Copy the file you want to modify (e.g., prices.lua )
  3. Paste it into jo_hairdresser_coloring/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...

4. For developers ​

Actions ​

Actions are one of the two types of Hooks. They provide a way to run 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 the available action in the jo_hairdresser_coloring script.

Client Init ​

Triggered when the add-on links to jo_hairdresser and registers its Hairdresser menu hooks.

lua
exports.jo_hairdresser_coloring: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_hairdresser_coloring filters and how to use them.

Client Can open color palette ​

Control whether the player can open the color palette.

lua
-- @param canOpen - boolean (default true)
exports.jo_hairdresser_coloring:registerFilter('canOpenColorPalette', function(canOpen)
	return canOpen
end)

When the palette is opened from another add-on, the external context is passed as a second argument.

lua
-- @param canOpen - boolean (default true)
-- @param context - table: external color palette context
exports.jo_hairdresser_coloring:registerFilter('canOpenColorPalette', function(canOpen, context)
	return canOpen
end)

Last updated: