👔 Premade Outfits
Documentation relating to the jo_clothingstore_outfits add-on for Clothing store script.
1. Installation
WARNING
Clothing store script is required to use this add-on
To install jo_clothingstore_outfits:
- Drag and drop the resource into your resources folder
- jo_clothingstore_outfits
- Add this ensure in your server.cfg after
ensure jo_clothingstoreensure jo_clothingstore_outfits
Congratulation, the Premade outfits add-on is ready to be used!
2. Usage
This add-on adds a Premade outfits menu in the clothing store/wardrobe.
- Open the clothing store, go to Outfits and select Premade outfits.
- Choose the premade outfit sex when the sex selection menu opens.
- Outfits are split into sections of 100 (Outfits 1 to 100, 101 to 200, ...).
- Select an outfit, use the variation slider to preview, then press the buy prompt to purchase.
- Purchased outfits are saved to the player's outfits list in jo_clothingstore.
If multiple payment options are configured for an outfit, use the Switch price prompt to cycle through them.
Premade outfits are separated into male and female catalogues. If the selected premade outfit sex is different from the player's current character, the preview is displayed on the opposite-sex mannequin.
Fixing body parts
Fixing body parts
Some premade outfits may not perfectly fit your character and can cause body clipping. If that happens, press the Fix body parts prompt to open the adjustment menu.
This menu lets you cycle through different upper and lower body variations to find the best fit for the selected outfit.
Once you purchase the outfit, the chosen body settings are saved with it, so you only need to adjust it once.
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
- Navigate to
jo_clothingstore_outfits/config/_default.lock/ - Copy the file you want to modify (e.g.,
prices.lua) - Paste it into
jo_clothingstore_outfits/config/custom/ - Edit the copied file in the
customfolder
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
Language Configuration
The script supports full translation through the language system. To override any text:
- Find the key you want to change in
config/_default.lock/lang.lua - Copy
lang.luatoconfig/custom/and add only the keys you want to override
Example:
Lang.premadeOutfits = "Premade outfits"
Lang.outfitSection = "Outfits %d to %d"
Lang.premadeOutfitBought = "Outfit %s purchased!"Available translation keys include:
- General UI text (
premadeOutfits,premadeOutfitsDesc) - Menu labels (
outfitSection,outfitItem) - Notifications (
premadeOutfitBought)
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_outfits script.
Client switchPrice
Triggered when user switch the outfit price
exports.jo_clothingstore_outfits:registerAction('switchPrice', function(priceIndex)
-- Your code here
end)Filters
Filters allow you to modify data or permissions synchronously at specific points in the script.
Server canBuyOutfit
Control whether a player can buy a premade outfit. This filter is called after the selected outfit has been cleaned and before the payment is charged.
-- @param canBuy - boolean (default true)
-- @param source - integer server ID of the player
-- @param name - string outfit name entered by the player
-- @param outfit - table cleaned outfit data that will be saved/applied
-- @param price - table selected price for the outfit
-- @param sexe - string outfit sex category
-- @param outfitIndex - integer premade outfit index
-- @param variationIndex - integer premade outfit variation index
exports.jo_clothingstore_outfits:registerFilter("canBuyOutfit", function(canBuy, source, name, outfit, price, sexe, outfitIndex, variationIndex)
return canBuy
end)Client canOpenPremadeOutfitsMenu
Control whether the player can open the premade outfits menu.
-- @param canOpen - boolean (default true)
exports.jo_clothingstore_outfits:registerFilter("canOpenPremadeOutfitsMenu", function(canOpen)
return canOpen
end)Server outfitSectionsAccess
Control which premade outfit types and sections are visible to a player. This server filter is called when the add-on opens the premade outfits menu after the player selects a sex in the main jo_clothingstore menu.
The filter receives the full access table and must return it. You can hide a complete type with access.types, or hide individual sections with access.sections.
-- @param access - table access configuration for the selected outfit sex
-- @param source - integer server ID of the player
-- @param sexe - string selected outfit sex: "male" or "female"
exports.jo_clothingstore_outfits:registerFilter("outfitSectionsAccess", function(access, source, sexe)
return access
end)Default contract:
local access = {
types = {
custom = true, -- Custom outfits type is visible
classic = true, -- Classic outfits type is visible
},
sections = {
custom = {
["Your custom category label 1"] = true, -- Custom category label
["Your custom category label 2"] = true,
},
classic = {
[1] = true, -- Outfits 1 to 100
[2] = true, -- Outfits 101 to 200
}
}
}If every type and section is denied, the menu is not opened and the player receives the noOutfitsForYou notification.
Example: allow only custom outfits:
exports.jo_clothingstore_outfits:registerFilter("outfitSectionsAccess", function(access, source, sexe)
access.types.classic = false
access.sections.classic = {}
return access
end)Example: allow only one custom category:
exports.jo_clothingstore_outfits:registerFilter("outfitSectionsAccess", function(access, source, sexe)
access.types.custom = true
access.types.classic = false
access.sections.custom = {
["Your custom category label 1"] = true,
}
access.sections.classic = {}
return access
end)Example: allow only the first classic section:
exports.jo_clothingstore_outfits:registerFilter("outfitSectionsAccess", function(access, source, sexe)
access.types.custom = false
access.types.classic = true
access.sections.custom = {}
access.sections.classic = {
[1] = true,
}
return access
end)Example: deny everything:
exports.jo_clothingstore_outfits:registerFilter("outfitSectionsAccess", function(access, source, sexe)
access.types.custom = false
access.types.classic = false
access.sections.custom = {}
access.sections.classic = {}
return access
end)Related jo_clothingstore filter
The premade outfits menu uses the outfit sex selection flow from the main jo_clothingstore resource. To disable opposite-sex premade outfit browsing and purchases, register this server filter from the main script jo_clothingstore:
Server canCreateOppositeSexOutfit
-- @param canCreate - boolean (default true)
-- @param source - serverID of the player
exports.jo_clothingstore:registerFilter("canCreateOppositeSexOutfit", function(canCreate, source)
return false
end)