# getVehicleLightState (Shared)

> Returns whether one or more lights of a vehicle are broken.

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

## Syntax

```lua
int|table|false getVehicleLightState(vehicle vehicle, int|string|table light)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `vehicle` | `vehicle` | The vehicle. |
| `light` | `int\|string\|table` | Which light: its number (0 front left, 1 front right, 2 rear right, 3 rear left), its frame name (`headlight_l`, `headlight_r`, `taillight_r`, `taillight_l`), a group (`all`, `front_lights`, `rear_lights`, `left_lights`, `right_lights`), `-1` for all of them or a table of several. |

## Returns

The state (0 working, 1 broken). When several lights were asked for (a group, `-1` or a table), a table of frame name → value. `false` if the vehicle lacks one of the lights named.

## Example

```lua
addCommandHandler("farol", function(player)
    local vehicle = getPedOccupiedVehicle(player)
    if vehicle and getVehicleLightState(vehicle, 0) == 1 then
        setVehicleLightState(vehicle, 0, 0)
    end
end)
```

## See also

- [setVehicleLightState (Shared)](https://wiki.mymp.gg/en/setVehicleLightState.md): Breaks or repairs one or more lights of a vehicle.
- [getVehicleDoorState (Shared)](https://wiki.mymp.gg/en/getVehicleDoorState.md): Returns the state of one or more doors of a vehicle.
- [getVehicleOverrideLights (Shared)](https://wiki.mymp.gg/en/getVehicleOverrideLights.md): Returns whether a vehicle's lights are forced on or off.
