# setLightSize (Client)

> Changes a rect light's width and height.

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

## Syntax

```lua
bool setLightSize(light light, float width, float height)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `light` | `light` | The light. |
| `width` | `float` | Width of the rectangle in metres, from 0.01 to 100. |
| `height` | `float` | Height of the rectangle in metres, from 0.01 to 100. |

## Returns

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

## Example

```lua
local light = createRectLight(1481.0, -1771.0, 22.0, 0, -1, 0, 12)
setLightSize(light, 3, 0.2)
```

### Note

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

## See also

- [getLightSize (Client)](https://wiki.mymp.gg/en/getLightSize.md): Reads 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.
- [setLightTangent (Client)](https://wiki.mymp.gg/en/setLightTangent.md): Changes where a rect light's width points, turning the rectangle about its normal.
