ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setPedVariant

Function

setPedVariant

ServerPedsTrilogy Hub only

Sets a pedestrian's appearance variant: the set of clothes and the skin tone. Every ped model in the Definitive Edition has 4 clothing variants (0-3) and 4 skin variants (0-3); the change is visible to every player. An omitted argument is randomised, which is why createPed gives each NPC a random look. Works for NPCs and for players using a ped skin.

Syntax

bool setPedVariant(ped ped [, int clothes = losowy / random, int skin = losowy / random])

Arguments

pedped
An NPC or a player with a ped skin.
clothesint, optional = losowy / random
Clothing variant 0-3 (0 = base).
skinint, optional = losowy / random
Skin variant 0-3 (0 = base).

Returns

true on success, false for values outside 0-3.

Example

local npc = createPed(7, 2490, -1670, 13.3)
setPedVariant(npc, 2, 0)

See also