Skip to content

๐Ÿด Horse breeding โ€‹

Documentation relating to the jo_stable_breeding add-on for Stable script.

1. Installation โ€‹

WARNING

Stable script is required to use this add-on

To install jo_stable_breeding:

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

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

2. Usage โ€‹

Go in the stable to start the breeding. You can select parents between your own horses.

3. Config.lua file โ€‹

The configuration file is config.lua in the resource root. Do not edit this file directly as your changes may be lost during updates. Instead, use overwriteConfig.lua to store your customizations.

  • config.lua - Default configuration maintained by developers. Do not modify this file.
  • overwriteConfig.lua - This is where you place only the values you want to override.

How to customize the configuration โ€‹

  1. Open /overwriteConfig.lua
  2. Find the value you want to change in config.lua (e.g., Config.language )
  3. Copy only that line into overwriteConfig.lua
  4. Edit the copied value to your liking

The script loads config.lua first, then overwriteConfig.lua overwrites only the values you redefine. This ensures your customizations are preserved when updating the script.

Loading configuration...

4. For developers โ€‹

Filters are the new way to modify data used by the script. These filters are fired at a specific point in time during the execution of the script. But contrary to events, filters are synchronous.

  • Syntax:
lua
-- @param <actionName> - name of the action
-- @param <argumentList> - list of arguments which are passed
exports.jo_stable_breeding:registerFilter(<actionName>, function(variable)
  -- Add your new data here
	return variable -- Don't forget to return the value
end)

Client Restrict the breeding โ€‹

Use it to restrict who can see the "Breeding" button in the stable menu

lua
-- @param canBreed - boolean
exports.jo_stable_breeding:registerFilter('canOpenBreedingMenu', function(canBreed)
	return canBreed
end)
Example of job lock for VORP
lua
AllowedJobs = {
    rhdHorsetrainer = true,
    blwHorsetrainer = true,
    valHorsetrainer = true,
}

exports.jo_stable_breeding:registerFilter('canOpenBreedingMenu', function(canBreed)
    local job = LocalPlayer.state.Character.Job
    if AllowedJobs[job] then
      return canBreed
    else
      jo.notif.rightError("You don't have the right job to tame wild horses")
      return false
    end
end)

Last updated: