# createPointLight (Client)

> Creates a light that shines in every direction from a point. The light exists on this client only.

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

## Syntax

```lua
light|false createPointLight(float x, y, z [, float radius = 10, color color = tocolor(255, 255, 255)])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `x, y, z` | `float` | The light's position in the world. |
| `radius` | `float` | Range in metres, above 0 and up to 1000. *(default: `10`)* |
| `color` | `color` | Three numbers `r, g, b` (integers from 0 to 255) or a `tocolor` value. Alpha is ignored. *(default: `tocolor(255, 255, 255)`)* |

## Returns

The created `light` element, or `false` if it could not be created.

A light outside the focused dimension or area is not drawn.

## Example

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

### Coming from MTA

MTA has no dynamic lights. To light a single frame without creating an element, use `dxDrawPointLight`.

## See also

- [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.
- [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.
- [setLightRadius (Client)](https://wiki.mymp.gg/en/setLightRadius.md): Changes a light's range.
- [dxDrawPointLight (Client)](https://wiki.mymp.gg/en/dxDrawPointLight.md): Lights a point in every direction for a single frame, without creating an element.
