tw.pedTexture
Side: Client
Ped texture overlay management for makeup, scars, hair, beards, and other appearance layers.
Data
tw.pedTexture.variations
Table of available overlay variations organized by category type. Categories include: acne, ageing, beard, blush, complex, disc, eyebrow, eyeliner, eyeshadow, foundation, freckles, grime, hair, lipstick, moles, scar, spots.
Functions
tw.pedTexture.apply(ped, layer_name, data)
Applies a texture overlay to a ped on the specified layer.
| Parameter | Type | Description |
|---|---|---|
ped | integer | Ped handle |
layer_name | string | Unique name for this overlay layer |
data | table | Overlay configuration (see below) |
Data fields:
| Field | Type | Description |
|---|---|---|
id | integer? | Overlay ID |
albedo | string? | Albedo texture hash |
normal | string? | Normal map texture hash |
material | string? | Material hash |
opacity | number? | Opacity (0.0 to 1.0) |
tint0 | integer? | Primary tint color |
tint1 | integer? | Secondary tint color |
tint2 | integer? | Tertiary tint color |
palette | string? | Color palette hash |
blendType | integer? | Blend type |
tw.pedTexture.apply(ped, "my_scar", {
albedo = "mp_head_mr1_sc08_001_ab",
normal = "mp_head_mr1_sc08_001_n",
opacity = 1.0,
})tw.pedTexture.remove(ped, layer_name)
Removes a texture overlay from a ped.
| Parameter | Type | Description |
|---|---|---|
ped | integer | Ped handle |
layer_name | string | Layer name to remove |
tw.pedTexture.remove(ped, "my_scar")tw.pedTexture.refreshAll(ped)
Re-applies all tracked overlay layers on the ped.
| Parameter | Type | Description |
|---|---|---|
ped | integer | Ped handle |
tw.pedTexture.refreshAll(ped)tw.pedTexture.refreshNow(ped)
Forces an immediate texture rebuild on the ped. Use this after applying multiple overlays to batch the GPU update.
| Parameter | Type | Description |
|---|---|---|
ped | integer | Ped handle |
tw.pedTexture.apply(ped, "scar_1", scar_data)
tw.pedTexture.apply(ped, "scar_2", scar_data_2)
tw.pedTexture.refreshNow(ped) -- single rebuild for bothtw.pedTexture.overwriteBodyPart(ped, category, overlays, force_remove?)
Replaces all overlays of a given category with a new set. Optionally removes the category entirely.
| Parameter | Type | Default | Description |
|---|---|---|---|
ped | integer | — | Ped handle |
category | string | — | Category name (e.g. "scar", "hair", "beard") |
overlays | table | — | Array of overlay data tables to apply |
force_remove | boolean? | false | If true, removes all layers of this category without applying new ones |
tw.pedTexture.overwriteBodyPart(ped, "scar", {
{ albedo = "mp_head_mr1_sc08_001_ab", opacity = 1.0 },
{ albedo = "mp_head_mr1_sc08_002_ab", opacity = 0.8 },
})tw.pedTexture.getAll(ped) -> table
Returns all currently tracked overlay layers for a ped.
| Parameter | Type | Description |
|---|---|---|
ped | integer | Ped handle |
Returns: table — Key-value table where keys are layer names and values are overlay data.
local layers = tw.pedTexture.getAll(ped)
for name, data in pairs(layers) do
print(name, data.albedo)
endtw.pedTexture.getOverlayAssetFromId(is_male, category, data) -> string
Resolves an overlay asset name from its numeric ID, accounting for gender and category.
| Parameter | Type | Description |
|---|---|---|
is_male | boolean | Whether the ped is male |
category | string | Category name (e.g. "scar", "beard") |
data | table | Overlay data containing at least id |
Returns: string — Asset name
local asset = tw.pedTexture.getOverlayAssetFromId(true, "scar", { id = 8 })Layer Categories
| Category | Description |
|---|---|
acne | Acne overlays |
ageing | Ageing / wrinkles |
beard | Facial hair |
blush | Blush makeup |
complex | Complexion overlays |
disc | Discoloration |
eyebrow | Eyebrows |
eyeliner | Eyeliner makeup |
eyeshadow | Eye shadow |
foundation | Foundation makeup |
freckles | Freckles |
grime | Dirt and grime |
hair | Head hair overlay |
lipstick | Lipstick |
moles | Moles and beauty marks |
scar | Scars |
spots | Spots |
Examples
Apply a scar and beard
local ped = tw.player.ped
tw.pedTexture.apply(ped, "facial_scar", {
albedo = "mp_head_mr1_sc08_001_ab",
normal = "mp_head_mr1_sc08_001_n",
opacity = 1.0,
})
tw.pedTexture.apply(ped, "my_beard", {
albedo = "mp_head_mr1_be01_001_ab",
opacity = 0.9,
tint0 = 1,
tint1 = 1,
tint2 = 1,
})
tw.pedTexture.refreshNow(ped)Remove all scars
tw.pedTexture.overwriteBodyPart(ped, "scar", {}, true)Notes
- Each
layer_nameis unique per ped. Applying a new overlay with the same layer name replaces the previous one. - Use
refreshNowafter applying multiple overlays to avoid redundant texture rebuilds. overwriteBodyPartwithforce_remove = trueand an empty overlay table clears the entire category.- The
variationsdata table can be used to build UI pickers for character customization.

