# setPedHairColor (Shared)

> Tints a ped's hair and, if you want, its highlights.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Shared
- **Category**: Appearance
- **URL**: https://wiki.mymp.gg/en/setPedHairColor

## Syntax

```lua
bool setPedHairColor(ped ped, int|color|bool color [, int|color highlight = nil])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `ped` | `ped` | The ped or player. |
| `color` | `int\|color\|bool` | A palette row (integer from 0 to 63) on its own, three numbers `r, g, b` or a `tocolor` value. `false` goes back to the hair's default colour. |
| `highlight` | `int\|color` | The highlights' colour, in the same form. Without it, the hair has no highlights. *(default: `nil`)* |

## Returns

`true` if it changed, `false` if it is not a ped.

On the server, the change is sent to every client. On the client, it applies to this client only.

## Example

```lua
addCommandHandler("cabelo", function(player, command, row, highlight)
    setPedHairColor(player, tonumber(row) or 0, tonumber(highlight))
end)
```

### Coming from MTA

MTA does not have this function. It follows FiveM's `SetPedHairColor`.

### Note

Three numbers in a row are read as `r, g, b`. For a palette row followed by highlights, give the highlights as a row or as `tocolor`.

## See also

- [getPedHairColor (Shared)](https://wiki.mymp.gg/en/getPedHairColor.md): Tells the colour of a ped's hair and of its highlights, if any.
- [setPedOverlayColor (Shared)](https://wiki.mymp.gg/en/setPedOverlayColor.md): Tints an overlay the ped wears on its face, by a palette row or by a colour.
- [setPedHeadBlend (Shared)](https://wiki.mymp.gg/en/setPedHeadBlend.md): Builds a ped's face by blending the head and skin of two parents.
