# engineSetWorldTexture (Client)

> Swaps a texture on every model of the chosen kinds that uses it. Only the models' materials change, not the txd the texture comes from.

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

## Syntax

```lua
bool engineSetWorldTexture(string name, texture|dui|bool source [, string targets = "world vehicle", int priority = 0])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `name` | `string` | The texture name, or a glob pattern, matched against every model's texture names. |
| `source` | `texture\|dui\|bool` | A `texture`, a `dui`, or `false` to hide the texture. |
| `targets` | `string` | Which models: `world`, `vehicle` and `ped`, separated by spaces or commas. *(default: `"world vehicle"`)* |
| `priority` | `int` | Among several swaps for the same texture, the highest priority answers; among equals, the newest. *(default: `0`)* |

## Returns

`true` once the swap is set. Raises an error if the source is not an image or `false`, or if a target is unknown.

The world's swaps answer under a model's (`engineSetModelTexture`) and an element's (`engineSetElementTexture`).

## Example

```lua
engineSetWorldTexture("*graffiti*", false, "world")
```

## See also

- [engineRestoreWorldTexture (Client)](https://wiki.mymp.gg/en/engineRestoreWorldTexture.md): Removes the world texture swaps this resource set with engineSetWorldTexture.
- [engineSetModelTexture (Client)](https://wiki.mymp.gg/en/engineSetModelTexture.md): Swaps a texture on every instance of a model. Only that model's materials change, not the txd the texture comes from.
- [engineSetElementTexture (Client)](https://wiki.mymp.gg/en/engineSetElementTexture.md): Swaps a texture on one vehicle, ped, player or object alone. Other instances of the same model keep their textures.
- [engineSetWorldMaterial (Client)](https://wiki.mymp.gg/en/engineSetWorldMaterial.md): Replaces the chosen materials of every model in the world with a material.
