# engineRequestModel (Client)

> Asks the streamer to load a model and keeps it loaded for this resource until it is released.

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

## Syntax

```lua
bool engineRequestModel(string|element model [, bool blocking = false])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `model` | `string\|element` | The model's name, or a `model` element made with `engineCreateModel`. |
| `blocking` | `bool` | `true` loads the model right away, holding the game until it is done. *(default: `false`)* |

## Returns

`true` when the request was made. With `blocking`, whether the model is loaded when the function returns.

Each resource holds its own request. The model stays loaded until every resource that asked for it calls `engineReleaseModel` or stops.

## Example

```lua
engineRequestModel("infernus")

setTimer(function()
    if engineHasModelLoaded("infernus") then
        outputDebugString("infernus is ready")
    end
end, 1000, 1)
```

### Coming from MTA

In MTA, `engineRequestModel` creates a new model. Here it loads an existing one, as SA's `REQUEST_MODEL` opcode does. To create a model, use `engineCreateModel`.

### Note

A name no model has, or a model without a drawable (collision only, for example), raises an error.

## See also

- [engineHasModelLoaded (Client)](https://wiki.mymp.gg/en/engineHasModelLoaded.md): Tells whether a model is loaded in memory.
- [engineReleaseModel (Client)](https://wiki.mymp.gg/en/engineReleaseModel.md): Drops the model request this resource made with engineRequestModel.
- [engineCreateModel (Client)](https://wiki.mymp.gg/en/engineCreateModel.md): Makes a new model under a name, on this client only. It is used by its name, like any other model.
