🐴 Horse taming
Documentation relating to the kd_stable_taming add-on for Stable script.
1. Installation
WARNING
Stable script is required to use this add-on
To install kd_stable_taming:
- Drag and drop the resource into your resources folder
- kd_stable_taming
- Add this ensure in your server.cfg after
ensure kd_stableensure kd_stable_taming
Congratulation, the Horse taming add-on is ready to be used!
2. Usage
Find a wild horse, calm it and go on stable to tame/sell it.
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
- Open
/overwriteConfig.lua - Find the value you want to change in
config.lua(e.g.,Config.language) - Copy only that line into
overwriteConfig.lua - 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.
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:
-- @param <actionName> - name of the action
-- @param <argumentList> - list of arguments which are passed
exports.kd_stable_taming:registerFilter(<actionName>, function(variable)
-- Add your new data here
return variable -- Don't forget to return the value
end)Client Restrict the selling
Fires after completed the selling prompt
-- @param canSell - boolean
exports.kd_stable_taming:registerFilter('canSellWildHorse', function(canSell)
return canSell
end)Client Restrict the taming
Fires after completed the taming prompt
-- @param canTame - boolean
exports.kd_stable_taming:registerFilter('canTameWildHorse', function(canTame)
return canTame
end)Example of job lock for VORP
AllowedJobs = {
rhdHorsetrainer = true,
blwHorsetrainer = true,
valHorsetrainer = true,
}
exports.kd_stable_taming:registerFilter('canTameWildHorse', function(canTame)
local job = LocalPlayer.state.Character.Job
if AllowedJobs[job] then
return canTame
else
jo.notif.rightError("You don't have the right job to tame wild horses")
return false
end
end)