RedM documentation

Murphy's Clothing

Advanced

API Documentation


This document provides comprehensive documentation for all exports and events available in murphy_clothing for use by developers in other scripts.


Table of Contents


Client-Side Exports

Naked State Management

IsPlayerNaked()

Checks if the player is currently naked (no clothes equipped, only MP body visible).

lua
local isNaked = exports.murphy_clothing:IsPlayerNaked()
-- Returns: boolean

ToggleNaked(notify)

Toggles between naked state and clothed state.

lua
local success = exports.murphy_clothing:ToggleNaked(true) -- true for notification
-- Returns: boolean (success)

Parameters:

Name Type Description
notify boolean If true, displays a notification to the player

SetNaked(naked, notify)

Sets a specific naked state for the player.

lua
local success = exports.murphy_clothing:SetNaked(true, true)
-- Returns: boolean (success)

Parameters:

Name Type Description
naked boolean true to undress, false to dress
notify boolean If true, displays a notification to the player

Clothing Information

GetEquippedCategories()

Returns a table of all currently equipped clothing categories with their model and texture data.

lua
local equippedCategories = exports.murphy_clothing:GetEquippedCategories()
--[[
Returns:
{
["hats"] = { model = 1, texture = 0 },
["coats"] = { model = 5, texture = { palette = 2, tint0 = 0, tint1 = 0, tint2 = 0 } },
...
}
]]

GetEquippedClothing()

Returns detailed information about all equipped clothing items.

lua
local equipped = exports.murphy_clothing:GetEquippedClothing()
--[[
Returns:
{
["hats"] = { model = 1, texture = 0, category = "hats" },
...
}
]]

IsClothingCategoryEquipped(category)

Checks if a specific clothing category is currently equipped.

lua
local hasHat = exports.murphy_clothing:IsClothingCategoryEquipped("hats")
-- Returns: boolean

Parameters:

Name Type Description
category string The clothing category to check (e.g., "hats", "coats", "shirts_full")

GetClothingInfo(category)

Returns detailed information about a specific clothing category if equipped.

lua
local hatInfo = exports.murphy_clothing:GetClothingInfo("hats")
--[[
Returns (if equipped):
{
category = "hats",
model = 1,
texture = 0,
temperature = "neutral"
}
Returns nil if not equipped
]]

Clothing Application

EquipMultipleClothes(clothesData, ped)

Equips multiple clothing items at once with support for model, texture (palette), and tint values.

lua
local success = exports.murphy_clothing:EquipMultipleClothes({
["hats"] = { model = 1, texture = 0, tint0 = 0, tint1 = 0, tint2 = 0 },
["shirts_full"] = { model = 5, texture = 2 },
["coats"] = { model = 3, texture = 1 }
}, PlayerPedId())
-- Returns: boolean (success)

Parameters:

Name Type Description
clothesData table Table of clothing categories with model/texture/tint data
ped number (Optional) Ped entity to apply clothes to, defaults to PlayerPedId()

Bandana/Mask Detection

IsBandanaEquipped()

Checks if the player has a bandana or mask equipped.

lua
local hasBandana = exports.murphy_clothing:IsBandanaEquipped()
-- Returns: boolean

Temperature/Metabolism System

GetTemperatureProtection()

Returns the player's temperature protection data based on equipped clothing.

lua
local protection = exports.murphy_clothing:GetTemperatureProtection()
--[[
Returns:
{
warmItems = 3, -- Number of warm clothing items equipped
coldItems = 1, -- Number of cold clothing items equipped
coldProtection = 2, -- Protection level against cold (0-3)
heatProtection = 1, -- Protection level against heat (0-3)
categories = {"coats", "shirts_full", "boots", "skirts"}
}
Protection levels:
0 = No protection
1 = Light protection
2 = Medium protection
3 = Heavy protection
]]

Server-Side Exports

Bandana/Mask Detection

IsBandanaEquipped(source)

Server-side check for bandana/mask equipment status.

lua
local hasBandana = exports.murphy_clothing:IsBandanaEquipped(source)
-- Returns: boolean

Parameters:

Name Type Description
source number Player server ID

Temperature/Metabolism System

GetPlayerTemperatureProtection(source)

Server-side function to get a player's temperature protection data.

lua
local protection = exports.murphy_clothing:GetPlayerTemperatureProtection(source)
--[[
Returns:
{
warmItems = 3,
coldItems = 1,
coldProtection = 2,
heatProtection = 1
}
]]

Client-Side Events

Wardrobe Mode

You can open the outfit list in wardrobe mode, where players can equip their saved outfits for free (no purchase required). This is perfect for housing, hotel rooms, or any changing area.

lua
TriggerEvent('murphy_clothes:OpenWardrobe')
This opens the same outfit list as the clothing store, but equipping an outfit will not charge the player. The invite command and store functionality remain unchanged.

Clothing Loading

murphy_clothing:loadclothes

Triggers the loading of the player's current clothes from the database.

lua
TriggerEvent('murphy_clothing:loadclothes')

Naked State Management

murphy_clothing:toggleNaked

Toggles the player's naked state.

lua
TriggerEvent('murphy_clothing:toggleNaked', true) -- notify: boolean

murphy_clothing:setNaked

Sets a specific naked state.

lua
TriggerEvent('murphy_clothing:setNaked', true, true) -- naked: boolean, notify: boolean

murphy_clothing:getNakedState

Gets the current naked state.

lua
TriggerEvent('murphy_clothing:getNakedState')
-- Returns the state via event return

Clothing Application

murphy_clothes:clotheitem

Applies a complete outfit to a ped.

lua
TriggerEvent('murphy_clothes:clotheitem', clothesTable, outfitId, targetPed, charId)

Parameters:

Name Type Description
clothesTable table Table containing clothing data for each category
outfitId string/number The outfit ID
targetPed number (Optional) Target ped entity
charId string/number (Optional) Character ID

murphy_clothes:itemclothes

Equips or unequips a single clothing category.

lua
TriggerEvent('murphy_clothes:itemclothes', category, model, texture)

Parameters:

Name Type Description
category string The clothing category (e.g., "hats", "coats")
model number The model index
texture number/table The texture index or table with palette/tint data

murphy_clothes:EquipMultipleClothes

Event version of EquipMultipleClothes export.

lua
TriggerEvent('murphy_clothes:EquipMultipleClothes', {
["hats"] = { model = 1, texture = 0 },
["shirts_full"] = { model = 5, texture = 2 }
}, PlayerPedId())

murphy_clothes:Equip-UnequipCategory

Toggles a specific clothing category on/off.

lua
TriggerEvent('murphy_clothes:Equip-UnequipCategory', "hats")

Wearable States

murphy_clothes:applyWearable

Applies wearable state data (bodies_upper, bodies_lower variations).

lua
TriggerEvent('murphy_clothes:applyWearable', wearableData, targetPed)

murphy_clothes:OpenClothingMenu

Opens the clothing menu.

lua
TriggerEvent('murphy_clothes:OpenClothingMenu')

murphy_clothing:OpenClothesMenuCreator

Opens the clothing menu in creator mode.

lua
TriggerEvent('murphy_clothing:OpenClothesMenuCreator')

murphy_clothing:ResetClothesMenuCreator

Resets the creator mode data.

lua
TriggerEvent('murphy_clothing:ResetClothesMenuCreator')

murphy_clothing:SaveClothesCreator

Saves the current outfit from creator mode.

lua
TriggerEvent('murphy_clothing:SaveClothesCreator')

Body Parts

murphy:clothing:RemoveAllClothes

Removes all clothes except essential categories.

lua
TriggerEvent('murphy:clothing:RemoveAllClothes', PlayerPedId())

murphy_clothes:LoadBasSkin

Loads and caches the base MP body skin.

lua
TriggerEvent('murphy_clothes:LoadBasSkin')

murphy_clothes:Loadlowerbody

Sets the lower body component in baseskin cache.

lua
TriggerEvent('murphy_clothes:Loadlowerbody', componentHash)

murphy_clothes:Loadupperbody

Sets the upper body component in baseskin cache.

lua
TriggerEvent('murphy_clothes:Loadupperbody', componentHash)

Character ID Based Loading

murphy_clothes:ApplyClothesToCharid

Applies clothes to a ped using a character ID.

lua
TriggerEvent('murphy_clothes:ApplyClothesToCharid', charId, targetPed)

Bandana/Mask Events

murphy_clothes:CheckBandana

Triggers a check for bandana status.

lua
TriggerEvent('murphy_clothes:CheckBandana')
-- Triggers 'murphy_clothes:BandanaStatus' with result

murphy_clothes:BandanaStatus

Receives bandana status (listener event).

lua
AddEventHandler('murphy_clothes:BandanaStatus', function(hasBandana)
-- hasBandana: boolean
end)

murphy_clothes:ToggleBandana

Triggered when bandana state changes. Also triggers syn_robbery:bandana for compatibility.

lua
AddEventHandler('murphy_clothes:ToggleBandana', function(state)
-- state: boolean (true = bandana up, false = bandana down)
end)

Temperature/Metabolism Events

murphy_clothes:GetTemperatureProtection

Requests temperature protection data.

lua
TriggerEvent('murphy_clothes:GetTemperatureProtection')
-- Triggers 'murphy_clothes:TemperatureProtectionData' with result

murphy_clothes:TemperatureProtectionData

Receives temperature protection data (listener event).

lua
AddEventHandler('murphy_clothes:TemperatureProtectionData', function(protection)
-- protection.warmItems
-- protection.coldItems
-- protection.coldProtection
-- protection.heatProtection
-- protection.categories
end)

murphy_clothes:OnClothingChanged

Triggered when any clothing category changes.

lua
AddEventHandler('murphy_clothes:OnClothingChanged', function(category, equipped)
-- category: string (clothing category that changed)
-- equipped: boolean (whether it's now equipped)
end)

murphy_clothes:TemperatureUpdate

Triggered after clothing changes with updated temperature data.

lua
AddEventHandler('murphy_clothes:TemperatureUpdate', function(protection)
-- Same structure as TemperatureProtectionData
end)

Outfit Change Events

murphy_clothes:outfitchanged

Triggered when an outfit is changed/loaded.

lua
AddEventHandler('murphy_clothes:outfitchanged', function()
-- Outfit has been changed
end)

Server-Side Events

Clothes Update

murphy_clothes:updateclothes

Updates the player's clothes in the database.

lua
TriggerServerEvent('murphy_clothes:updateclothes', clothesTable, outfitId)

Callbacks

Murphy Clothing uses a custom callback system. Here are the available server callbacks:

murphy_clothing:GetCurrentClothes

Gets the current clothes for the player.

lua
Callback.triggerServer('murphy_clothing:GetCurrentClothes', function(datatable, outfitId)
-- datatable: table of clothes data
-- outfitId: current outfit ID
end)

murphy_clothing:GetCurrentClothesCharid

Gets clothes for a specific character ID.

lua
Callback.triggerServer('murphy_clothing:GetCurrentClothesCharid', function(datatable, outfitId)
-- datatable: table of clothes data
-- outfitId: outfit ID
end, characterId)

murphy_clothing:GetOutfit

Gets a specific outfit by ID.

lua
Callback.triggerServer('murphy_clothing:GetOutfit', function(datatable, gender)
-- datatable: outfit clothes data
-- gender: "male" or "female"
end, outfitId)

murphy_clothing:GetCurrentOutfitList

Gets list of all saved outfits for the player.

lua
Callback.triggerServer('murphy_clothing:GetCurrentOutfitList', function(outfitList)
-- outfitList: array of outfit records
end)

murphy_clothing:GetWearable

Gets wearable state data for an outfit.

lua
Callback.triggerServer('murphy_clothing:GetWearable', function(datatable)
-- datatable: wearable state data
end, outfitId, charId)

murphy_clothing:IsBandanaEquipped

Server-side callback to check bandana status.

lua
Callback.triggerServer('murphy_clothing:IsBandanaEquipped', function(hasBandana)
-- hasBandana: boolean
end)

murphy_clothing:GetPlayerTemperatureProtection

Gets temperature protection data from server.

lua
Callback.triggerServer('murphy_clothing:GetPlayerTemperatureProtection', function(protection)
-- protection: temperature data table
end)

Usage Examples

Example 1: Check and React to Bandana State

lua
-- Using export
if exports.murphy_clothing:IsBandanaEquipped() then
print("Player has bandana/mask equipped!")
end
-- Using event
AddEventHandler('murphy_clothes:ToggleBandana', function(state)
if state then
-- Player put on bandana - hide identity
TriggerEvent('your_script:hideIdentity')
else
-- Player removed bandana - show identity
TriggerEvent('your_script:showIdentity')
end
end)

Example 2: Metabolism/Temperature Integration

lua
-- Get temperature protection for survival scripts
local protection = exports.murphy_clothing:GetTemperatureProtection()
if protection.coldProtection < 2 then
-- Player doesn't have enough warm clothing
print("Player will get cold damage!")
end
-- Listen for clothing changes
AddEventHandler('murphy_clothes:TemperatureUpdate', function(protection)
-- Update metabolism based on new clothing
UpdatePlayerMetabolism(protection)
end)

Example 3: Apply Custom Outfit Programmatically

lua
-- Equip multiple items at once
exports.murphy_clothing:EquipMultipleClothes({
["hats"] = { model = 5, texture = 2 },
["coats"] = { model = 10, texture = 1, tint0 = 5, tint1 = 0, tint2 = 0 },
["shirts_full"] = { model = 3, texture = 0 },
["pants"] = { model = 8, texture = 2 },
["boots"] = { model = 4, texture = 1 }
})

Example 4: Toggle Specific Clothing

lua
-- Toggle hat on/off
TriggerEvent('murphy_clothes:Equip-UnequipCategory', "hats")
-- Check if specific category is equipped
if exports.murphy_clothing:IsClothingCategoryEquipped("coats") then
print("Player is wearing a coat")
end

Example 5: Get/Set Naked State for Medic/Hospital Scripts

lua
-- Undress player for medical examination
exports.murphy_clothing:SetNaked(true, true)
-- After treatment, dress player back
exports.murphy_clothing:SetNaked(false, true)
-- Toggle naked (useful for keybinds)
exports.murphy_clothing:ToggleNaked(true)

Example 6: Load Clothes for Another Character (Admin/Staff)

lua
-- Load clothes for a specific character onto a ped
local targetPed = GetPedInFront()
local characterId = "12345"
TriggerEvent('murphy_clothes:ApplyClothesToCharid', characterId, targetPed)

Clothing Categories Reference

Here is a list of common clothing categories:

Category Description
hats Hats
hat_accessories Hat accessories
masks Masks/Bandanas
masks_large Large masks
eyewear Glasses/Eyewear
headwear Headwear
coats Coats
coats_closed Closed coats
coats_heavy Heavy coats
shirts_full Full shirts
vests Vests
suspenders Suspenders
ponchos Ponchos
cloaks Cloaks
pants Pants
skirts Skirts
boots Boots
boot_accessories Boot accessories
chaps Chaps
spats Spats
gloves Gloves
gunbelts Gun belts
holsters_right Right holsters
holsters_left Left holsters
satchels Satchels
neckwear Neckwear
neckties Neckties
neckerchiefs Neckerchiefs
jewelry_rings_left Left rings
jewelry_rings_right Right rings
jewelry_bracelets Bracelets
jewelry_necklaces Necklaces
jewelry_earrings Earrings
bodies_upper Upper body (MP Body)
bodies_lower Lower body (MP Body)

Temperature Configuration

The temperature system uses categories from Config.ClothingTemperature:

lua
-- Example configuration in config.lua
Config.ClothingTemperature = {
["coats"] = "warm", -- Provides warmth
["ponchos"] = "warm",
["cloaks"] = "warm",
["boots"] = "warm",
["skirts"] = "cold", -- Provides cooling
["pants"] = "neutral", -- No effect
}

Protection levels are calculated based on the number of warm/cold items equipped as defined in Config.TemperatureProtection.


Notes

  • All client exports should be called from client-side scripts only
  • All server exports should be called from server-side scripts only
  • The callback system is internal to murphy_clothing - use the provided events/exports for integration
  • When applying clothes programmatically, ensure the model and texture indices exist in MURPHY_ASSETS
  • Temperature protection is calculated in real-time when requested

Last updated: April 2, 2026