Bablo ResourcesDocs

Work Outfit

While their crew has a work order, every crew member wears work clothes. By default these are green coveralls from the Heist DLC, a yellow construction helmet, yellow work gloves and work boots. When the work order ends, each player gets their own clothes back exactly as they were.


When the outfit changes

MomentWhat happens
The crew leader starts a routeEvery member of the crew puts on the work outfit. A solo player does too. See Work Orders.
The route endsThe own clothes come back. This is when the van is returned and paid, when the work order is cancelled, and when the van is lost.
A player leaves the crew or the missionThat player gets their own clothes back.
The resource stopsEveryone wearing the outfit gets their own clothes back.
The player logs out of the characterThe saved clothes are dropped instead of put back. See Logging out.

Only the slots listed in Config.WorkOutfit are changed and saved. Everything else the player wears stays as it is.

The outfit only works on the two multiplayer characters, mp_m_freemode_01 and mp_f_freemode_01. A player using any other ped model keeps their clothes.


Settings

LUA
Config.WorkOutfit = {
    enabled = true,
    male = {
        components = {
            [3] = { 64, 0 },
            [4] = { 38, 2 },
            [6] = { 12, 0 },
            [8] = { 15, 0 },
            [9] = { 0, 0 },
            [10] = { 0, 0 },
            [11] = { 65, 2 },
        },
        props = {
            [0] = { 145, 0 },
        },
    },
    female = {
        components = {
            [3] = { 75, 0 },
            [4] = { 38, 2 },
            [6] = { 68, 0 },
            [8] = { 15, 0 },
            [9] = { 0, 0 },
            [10] = { 0, 0 },
            [11] = { 59, 2 },
        },
        props = {
            [0] = { 144, 0 },
        },
    },
}
SettingWhat it does
enabledfalse turns the work outfit off. Players keep their own clothes for the whole route.
maleThe outfit for mp_m_freemode_01.
femaleThe outfit for mp_f_freemode_01.
componentsClothing slots. The key is the slot number, the value is { drawable, texture }.
propsProp slots, set the same way. A drawable of -1 removes the prop, for example [1] = { -1, 0 } takes off glasses.

Slots used by default

SlotKindMaleFemaleDefault item
Component 3Arms and gloves{ 64, 0 }{ 75, 0 }Yellow work gloves
Component 4Legs{ 38, 2 }{ 38, 2 }Coverall trousers
Component 6Shoes{ 12, 0 }{ 68, 0 }Work boots
Component 8Undershirt{ 15, 0 }{ 15, 0 }None
Component 9Vest{ 0, 0 }{ 0, 0 }None
Component 10Decals{ 0, 0 }{ 0, 0 }None
Component 11Tops{ 65, 2 }{ 59, 2 }Coverall top
Prop 0Hats{ 145, 0 }{ 144, 0 }Yellow construction helmet

You can add other slots, for example component 1 for masks or component 5 for bags, and remove slots you don’t want changed.


Logging out

On a character logout the saved clothes are dropped instead of put back. That way a character you switch to is not dressed in the clothes of the previous one. The script listens to these events:

FrameworkEvent
QBCoreQBCore:Client:OnPlayerUnload
Qboxqbx_core:client:playerLoggedOut
ESXesx:onPlayerLogout

The own clothes are also not put back when the player’s ped model has changed since the outfit went on.


Using another clothing script

The outfit code is in frameworks/outfit/client.lua, which is not escrowed. To dress players through your clothing script instead, change the two functions in that file:

FunctionCalledMust do
ElectricOutfit.wear()On every crew update while a work order runs, so many times per routePut on the work clothes once, and do nothing when they are already on.
ElectricOutfit.remove()On every crew update while the player has no work order, and when the resource stopsPut the player’s own clothes back, and do nothing when the work clothes are not on.

Leave ElectricOutfit.sync and the logout handlers as they are. The file keeps its state in the local saved, which the logout handlers clear. If you keep using saved as the “wearing” flag, logouts keep working:

LUA
function ElectricOutfit.wear()
    if saved or Config.WorkOutfit.enabled == false then return end
    saved = true
    exports['your-clothing']:WearJobOutfit('electrician')
end
 
function ElectricOutfit.remove()
    if not saved then return end
    saved = nil
    exports['your-clothing']:RestoreOwnClothes()
end

your-clothing, WearJobOutfit and RestoreOwnClothes stand for the resource and functions of your clothing script. All files you can open are shown in the Script Explorer.