# setLightCone (Client)

> Changes the opening and the edge hardness of a spot light's cone.

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

## Syntax

```lua
bool setLightCone(light light, float angle [, float hardness = nil])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `light` | `light` | The light. |
| `angle` | `float` | Half the cone's opening, in degrees from its axis, above 0 and up to 90. |
| `hardness` | `float` | Fraction of the cone lit fully, from 0 to 1. Anything above 0.99 counts as 0.99. Left out, the current hardness is kept. *(default: `nil`)* |

## Returns

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

## Example

```lua
local light = createSpotLight(2495.1, -1687.4, 20, 0, 0, -1, 25)
setLightCone(light, 15, 0.9)
```

### Note

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

## See also

- [getLightCone (Client)](https://wiki.mymp.gg/en/getLightCone.md): Reads the opening and the edge hardness of a spot light's cone.
- [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.
- [setLightSourceRadius (Client)](https://wiki.mymp.gg/en/setLightSourceRadius.md): Changes the size of a spot light's bulb. A larger bulb makes highlights and shadows softer.
