# setLightBarnDoor (Client)

> Changes a rect light's barn doors, which limit where the light leaves the rectangle.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Lights
- **URL**: https://wiki.mymp.gg/en/setLightBarnDoor

## Syntax

```lua
bool setLightBarnDoor(light light, float angle, float length)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `light` | `light` | The light. |
| `angle` | `float` | Angle of the barn doors from the normal, from 0 to 90 degrees. From 88 up they block nothing. |
| `length` | `float` | Length of the barn doors in metres, 0 or more. |

## Returns

`true` if it changed. With a wrong argument it logs a warning and returns `false`.

A new light starts at 88 degrees and 0.2 metres.

## Example

```lua
local light = createRectLight(1481.0, -1771.0, 22.0, 0, 0, -1, 10)
setLightBarnDoor(light, 30, 0.5)
```

### Note

Rect lights only. On a point or spot light it logs a warning naming its type and returns `false`.

## See also

- [getLightBarnDoor (Client)](https://wiki.mymp.gg/en/getLightBarnDoor.md): Reads a rect light's barn doors.
- [setLightSize (Client)](https://wiki.mymp.gg/en/setLightSize.md): Changes a rect light's width and height.
- [createRectLight (Client)](https://wiki.mymp.gg/en/createRectLight.md): Creates a light that comes from a rectangle, like a panel or a lit window. The light exists on this client only.
