# setElementCastShadow (Client)

> Turns the shadow an element casts on or off.

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

## Syntax

```lua
bool setElementCastShadow(element element, bool castShadow)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `element` | `element` | The player, ped, vehicle or object. |
| `castShadow` | `bool` | `true` to cast a shadow, `false` not to. |

## Returns

`true` if it applied, `false` if the element is not a world element.

It applies to every part the element draws. The choice is kept while the element is streamed out.

## Example

```lua
local object = createObject("kb_bandit_u", 2495, -1687, 13.5)
setElementCastShadow(object, false)
```

## See also

- [getElementCastShadow (Client)](https://wiki.mymp.gg/en/getElementCastShadow.md): Tells whether an element casts a shadow.
- [setLightCastShadow (Client)](https://wiki.mymp.gg/en/setLightCastShadow.md): Turns a light's shadows on or off.
