# engineGetModelMaterials (Client)

> Lists the loaded model's materials, in the order the model keeps them.

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

## Syntax

```lua
table|false engineGetModelMaterials(string|element model)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `model` | `string\|element` | The model's name or a `model` element. |

## Returns

A list where each material has `index` (from 1), `name`, `texture`, `shader` and `cutout`. `false` when the model is not loaded.

The `index` and the `name` are what `engineSetModelMaterial` and the other material functions take to pick a material.

## Example

```lua
local materials = engineGetModelMaterials("infernus")
if materials then
    for _, material in ipairs(materials) do
        outputDebugString(material.index .. " " .. material.name .. " " .. material.texture)
    end
end
```

### Note

A name that is not a model is an error.

## See also

- [engineSetModelMaterial (Client)](https://wiki.mymp.gg/en/engineSetModelMaterial.md): Replaces the chosen materials of every instance of a model 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.
- [engineGetModelTxds (Client)](https://wiki.mymp.gg/en/engineGetModelTxds.md): Lists the txds a model takes its textures from, in the order it searches them.
