# engineCreateTxd (Client)

> Creates an empty texture dictionary under a name. Fill it with `engineSetTxdTexture`. It exists on this client only.

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

## Syntax

```lua
txd engineCreateTxd(string name)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `name` | `string` | The dictionary's name. Models and the functions that take a txd's name find it by this name. |

## Returns

The new `txd` element. Raises an error if the name is empty or another script's txd already has it.

The txd is ready at once, and nothing evicts it while its element lives.

## Example

```lua
local txd = engineCreateTxd("custom_lights")
local lights = engineCreateTexture("images/lights.png")
engineSetTxdTexture(txd, "vehiclelights128", lights)
engineSetModelTxd("infernus", txd)
```

### Note

If a pack already has a txd with that name, the new one covers it while it lives. A warning is logged.

## See also

- [engineLoadTxd (Client)](https://wiki.mymp.gg/en/engineLoadTxd.md): Loads a texture dictionary (.ktd) from a resource file under a name. It exists on this client only.
- [engineSetTxdTexture (Client)](https://wiki.mymp.gg/en/engineSetTxdTexture.md): Puts an image in a txd under a texture name, replacing the texture of that name or adding a new one. Everything that reads the txd follows: models, peds, landscapes, roads, particles, water and sky.
- [engineSetModelTxd (Client)](https://wiki.mymp.gg/en/engineSetModelTxd.md): Puts a txd in front of a model's own, so the model finds its textures there first and falls back to its own for the rest.
- [engineGetTxds (Client)](https://wiki.mymp.gg/en/engineGetTxds.md): Lists every texture dictionary this client knows, with where each one comes from.
