Skip to content

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.

ParameterTypeDescription
pedintegerPed handle
layer_namestringUnique name for this overlay layer
datatableOverlay configuration (see below)

Data fields:

FieldTypeDescription
idinteger?Overlay ID
albedostring?Albedo texture hash
normalstring?Normal map texture hash
materialstring?Material hash
opacitynumber?Opacity (0.0 to 1.0)
tint0integer?Primary tint color
tint1integer?Secondary tint color
tint2integer?Tertiary tint color
palettestring?Color palette hash
blendTypeinteger?Blend type
lua
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.

ParameterTypeDescription
pedintegerPed handle
layer_namestringLayer name to remove
lua
tw.pedTexture.remove(ped, "my_scar")

tw.pedTexture.refreshAll(ped)

Re-applies all tracked overlay layers on the ped.

ParameterTypeDescription
pedintegerPed handle
lua
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.

ParameterTypeDescription
pedintegerPed handle
lua
tw.pedTexture.apply(ped, "scar_1", scar_data)
tw.pedTexture.apply(ped, "scar_2", scar_data_2)
tw.pedTexture.refreshNow(ped) -- single rebuild for both

tw.pedTexture.overwriteBodyPart(ped, category, overlays, force_remove?)

Replaces all overlays of a given category with a new set. Optionally removes the category entirely.

ParameterTypeDefaultDescription
pedintegerPed handle
categorystringCategory name (e.g. "scar", "hair", "beard")
overlaystableArray of overlay data tables to apply
force_removeboolean?falseIf true, removes all layers of this category without applying new ones
lua
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.

ParameterTypeDescription
pedintegerPed handle

Returns: table — Key-value table where keys are layer names and values are overlay data.

lua
local layers = tw.pedTexture.getAll(ped)
for name, data in pairs(layers) do
    print(name, data.albedo)
end

tw.pedTexture.getOverlayAssetFromId(is_male, category, data) -> string

Resolves an overlay asset name from its numeric ID, accounting for gender and category.

ParameterTypeDescription
is_malebooleanWhether the ped is male
categorystringCategory name (e.g. "scar", "beard")
datatableOverlay data containing at least id

Returns: string — Asset name

lua
local asset = tw.pedTexture.getOverlayAssetFromId(true, "scar", { id = 8 })

Layer Categories

CategoryDescription
acneAcne overlays
ageingAgeing / wrinkles
beardFacial hair
blushBlush makeup
complexComplexion overlays
discDiscoloration
eyebrowEyebrows
eyelinerEyeliner makeup
eyeshadowEye shadow
foundationFoundation makeup
frecklesFreckles
grimeDirt and grime
hairHead hair overlay
lipstickLipstick
molesMoles and beauty marks
scarScars
spotsSpots

Examples

Apply a scar and beard

lua
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

lua
tw.pedTexture.overwriteBodyPart(ped, "scar", {}, true)

Notes

  • Each layer_name is unique per ped. Applying a new overlay with the same layer name replaces the previous one.
  • Use refreshNow after applying multiple overlays to avoid redundant texture rebuilds.
  • overwriteBodyPart with force_remove = true and an empty overlay table clears the entire category.
  • The variations data table can be used to build UI pickers for character customization.

Premium RedM Scripts — Multi-Framework