# engineSetWorldOverlay (Client)

> Draws a material as an extra layer over the chosen materials of every model in the world.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Materials and shaders
- **URL**: https://wiki.mymp.gg/en/engineSetWorldOverlay

## Syntax

```lua
bool engineSetWorldOverlay(int|string selector, material material [, string targets = world vehicle, int priority = 0, int order = 0])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `selector` | `int\|string` | Which material: its index from 1 or its name, as `engineGetModelMaterials` lists them. The name ignores case and takes the `*` and `?` wildcards. |
| `material` | `material` | The material drawn on top. |
| `targets` | `string` | Which models it reaches: `world`, `vehicle` and `ped`, split by spaces or commas. *(default: `world vehicle`)* |
| `priority` | `int` | Breaks ties between layers of the same order: the higher priority is drawn later. *(default: `0`)* |
| `order` | `int` | The order among the layers of the same material, lowest first. *(default: `0`)* |

## Returns

`true` when it was applied.

Every layer that picks a material is drawn, by order and then by priority.

## Example

```lua
local snow = engineCreateMaterial("surface_alpha")
engineSetWorldOverlay("*grass*", snow, "world", 0, 1)
```

## See also

- [engineRestoreWorldOverlay (Client)](https://wiki.mymp.gg/en/engineRestoreWorldOverlay.md): Undoes what this resource's engineSetWorldOverlay did of every model in the world.
- [engineSetWorldMaterial (Client)](https://wiki.mymp.gg/en/engineSetWorldMaterial.md): Replaces the chosen materials of every model in the world with a material.
- [engineSetModelOverlay (Client)](https://wiki.mymp.gg/en/engineSetModelOverlay.md): Draws a material as an extra layer over the chosen materials of every instance of a model.
- [engineCreateMaterial (Client)](https://wiki.mymp.gg/en/engineCreateMaterial.md): Creates a material: a shader with parameter values, which then replaces or overlays the materials of models.
