From the reference libraryRedM

Ped Texture <BadgeClient/>

jo_libs/modules/ped-texture/client.md

Ped Texture <BadgeClient/>

A powerfull module to manage the ped texture like makeup/tatoo/...

:::warning Textures can only be apply on networked ped. If you want use it in a script with ped only visible by one player, like character selector, you have to move the player in solo routing bucket and spawn the ped as networked. :::

JO Variables > jo.pedTexture.categories

An object to know the on each part of the ped the layername has to be apply

JO Variables > jo.pedTexture.categories > Syntax

jo.pedTexture.categories[layername]

JO Variables > jo.pedTexture.categories > Parameters

layername : string

The layer name of the texture

JO Variables > jo.pedTexture.categories > Example

local part = jo.pedTexture.categories.eyeshadow
print(part)
-- Expected output: heads

JO Variables > jo.pedTexture.variations

A variable with the list of existing texture for peds. The key is the layername and value the list of variations

JO Variables > jo.pedTexture.variations > Syntax

jo.pedTexture.variations[layername] = variations

JO Variables > jo.pedTexture.variations > Parameters

layername : string

The layername of the texture

variations : table

the list of variations
variations[x].label : string - the label of the variations
variations[x].value : table - the definition of the variations

JO Variables > jo.pedTexture.variations > Example

local listEyeshadow = jo.pedTexture.variations.eyeshadow
for _, variation in pairs(listEyeshadow) do
    log(variation)
end

JO Functions > jo.pedTexture.apply()

<!-- @include: ./slots/headers.md#g_client|jo.pedTexture.apply -->

A function to apply texture on a specific ped <br>

<!-- @include: ./slots/descriptions.md#g_client|jo.pedTexture.apply -->

JO Functions > jo.pedTexture.apply() > Syntax

jo.pedTexture.apply(ped, layerName, _data)

JO Functions > jo.pedTexture.apply() > Parameters

ped : integer

The entity ID

layerName : string

The layername of the texture

_data : table

The data of the texture

_data.id : integer - The ID of the texture <br> OR

_data.albedo : string - The albedo of the texture

_data.sheetGrid : integer - The sheet grid of the texture <br> default: 0 <BadgeOptional />

_data.opacity : number - The opacity of the texture <br> default: 1.0 <BadgeOptional />

_data.blendType : integer - The blend type of the texture <br> default: 1 <BadgeOptional />

_data.palette : string|integer - The palette of the colors <br> default: "metaped_tint_makeup" <BadgeOptional />

_data.tint0 : string|integer - The first color <BadgeOptional />

_data.tint1 : string|integer - The second color <BadgeOptional />

_data.tint2 : string|integer - The third color <BadgeOptional />

<!-- @include: ./slots/examples.md#g_client|jo.pedTexture.apply -->

<!-- @include: ./slots/footers.md#g_client|jo.pedTexture.apply -->


JO Functions > jo.pedTexture.getAll()

<!-- @include: ./slots/headers.md#g_client|jo.pedTexture.getAll -->

Return the list of layers in all categories <br>

<!-- @include: ./slots/descriptions.md#g_client|jo.pedTexture.getAll -->

JO Functions > jo.pedTexture.getAll() > Syntax

jo.pedTexture.getAll(ped)

JO Functions > jo.pedTexture.getAll() > Parameters

ped : integer

The entity ID

JO Functions > jo.pedTexture.getAll() > Return Value

Type : object

Return the list of layer apply on the ped

<!-- @include: ./slots/examples.md#g_client|jo.pedTexture.getAll -->

<!-- @include: ./slots/footers.md#g_client|jo.pedTexture.getAll -->


JO Functions > jo.pedTexture.getOverlayAssetFromId()

<!-- @include: ./slots/headers.md#g_client|jo.pedTexture.getOverlayAssetFromId -->

A function to get the hashname of a texture <br>

<!-- @include: ./slots/descriptions.md#g_client|jo.pedTexture.getOverlayAssetFromId -->

JO Functions > jo.pedTexture.getOverlayAssetFromId() > Syntax

jo.pedTexture.getOverlayAssetFromId(isMale, category, data)

JO Functions > jo.pedTexture.getOverlayAssetFromId() > Parameters

isMale : boolean

true if the texture is for a male, false otherwise

category : string

The layername of the texture

data : table|integer

The texture data <br> ⚠️ Can be either a number representing the texture ID or a table with detailed configuration

JO Functions > jo.pedTexture.getOverlayAssetFromId() > Return Value

Type : string

Return the hashname of the texture for this ID

<!-- @include: ./slots/examples.md#g_client|jo.pedTexture.getOverlayAssetFromId -->

<!-- @include: ./slots/footers.md#g_client|jo.pedTexture.getOverlayAssetFromId -->


JO Functions > jo.pedTexture.overwriteBodyPart()

<!-- @include: ./slots/headers.md#g_client|jo.pedTexture.overwriteBodyPart -->

A function to overwrite all the layers of a body part <br>

<!-- @include: ./slots/descriptions.md#g_client|jo.pedTexture.overwriteBodyPart -->

JO Functions > jo.pedTexture.overwriteBodyPart() > Syntax

jo.pedTexture.overwriteBodyPart(ped, category, overlays, forceRemove)

JO Functions > jo.pedTexture.overwriteBodyPart() > Parameters

ped : integer

The entity ID

category : string

The category of the texture

overlays : object

The list of layers

forceRemove : boolean <BadgeOptional />

Whether to force remove existing textures even if the category doesn't exist <br> default: false

<!-- @include: ./slots/examples.md#g_client|jo.pedTexture.overwriteBodyPart -->

<!-- @include: ./slots/footers.md#g_client|jo.pedTexture.overwriteBodyPart -->


JO Functions > jo.pedTexture.refreshAll()

<!-- @include: ./slots/headers.md#g_client|jo.pedTexture.refreshAll -->

A function to refresh the ped texture <br>

<!-- @include: ./slots/descriptions.md#g_client|jo.pedTexture.refreshAll -->

JO Functions > jo.pedTexture.refreshAll() > Syntax

jo.pedTexture.refreshAll(ped)

JO Functions > jo.pedTexture.refreshAll() > Parameters

ped : integer

The entity ID

<!-- @include: ./slots/examples.md#g_client|jo.pedTexture.refreshAll -->

<!-- @include: ./slots/footers.md#g_client|jo.pedTexture.refreshAll -->


JO Functions > jo.pedTexture.refreshNow()

<!-- @include: ./slots/headers.md#g_client|jo.pedTexture.refreshNow -->

A function to apply now the ped texture modification <br>

<!-- @include: ./slots/descriptions.md#g_client|jo.pedTexture.refreshNow -->

JO Functions > jo.pedTexture.refreshNow() > Syntax

jo.pedTexture.refreshNow(ped)

<!-- @include: ./slots/examples.md#g_client|jo.pedTexture.refreshNow -->

<!-- @include: ./slots/footers.md#g_client|jo.pedTexture.refreshNow -->


JO Functions > jo.pedTexture.remove()

<!-- @include: ./slots/headers.md#g_client|jo.pedTexture.remove -->

A function to remove a texture <br>

<!-- @include: ./slots/descriptions.md#g_client|jo.pedTexture.remove -->

JO Functions > jo.pedTexture.remove() > Syntax

jo.pedTexture.remove(ped, layerName)

JO Functions > jo.pedTexture.remove() > Parameters

ped : integer

The entity ID

layerName : string

The layer name of the texture

<!-- @include: ./slots/examples.md#g_client|jo.pedTexture.remove -->

<!-- @include: ./slots/footers.md#g_client|jo.pedTexture.remove -->

Back to documentation