# setVehicleHeadLightColor (Shared)

> Changes the colour of a vehicle's headlights.

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

## Syntax

```lua
bool setVehicleHeadLightColor(element vehicle, color color)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `vehicle` | `element` | The vehicle, or a parent element whose vehicles all change. |
| `color` | `color` | Three numbers `r, g, b` (integers from 0 to 255) or a `tocolor` value. Alpha is ignored. |

## Returns

`true` if the colour was applied, `false` if the element is not a vehicle.

Given a parent element such as `root`, it applies to every vehicle below it, but the value returned is the element's own: `false` when it is not a vehicle.

## Example

```lua
addCommandHandler("xenon", function(player)
    local vehicle = getPedOccupiedVehicle(player)
    if vehicle then
        setVehicleHeadLightColor(vehicle, 170, 200, 255)
    end
end)
```

## See also

- [getVehicleHeadLightColor (Shared)](https://wiki.mymp.gg/en/getVehicleHeadLightColor.md): Returns the colour of a vehicle's headlights.
- [setVehicleOverrideLights (Shared)](https://wiki.mymp.gg/en/setVehicleOverrideLights.md): Forces a vehicle's lights on or off, or hands the choice back to the game.
- [setVehicleNeonColor (Shared)](https://wiki.mymp.gg/en/setVehicleNeonColor.md): Changes the colour of a vehicle's neon. The colour applies to every strip.
