# setLightCastShadow (Client)

> Turns a light's shadows on or off.

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

## Syntax

```lua
bool setLightCastShadow(light light, bool castShadow)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `light` | `light` | The light. |
| `castShadow` | `bool` | Whether the light casts shadows. |

## Returns

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

With a shadow, a spot light uses one view with its own cone; a point or rect light uses a cube of six views from its centre.

## Example

```lua
local light = createPointLight(2495.1, -1687.4, 14.5, 12)
setLightCastShadow(light, true)
```

## See also

- [getLightCastShadow (Client)](https://wiki.mymp.gg/en/getLightCastShadow.md): Tells whether a light casts shadows.
- [setElementCastShadow (Client)](https://wiki.mymp.gg/en/setElementCastShadow.md): Turns the shadow an element casts on or off.
- [createSpotLight (Client)](https://wiki.mymp.gg/en/createSpotLight.md): Creates a light that shines inside a cone, like a spotlight. The light exists on this client only.
