# engineCreateModel (Client)

> Makes a new model under a name, on this client only. It is used by its name, like any other model.

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

## Syntax

```lua
element engineCreateModel(string name, string kind [, string|element parent = nil])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `name` | `string` | The model's name. No other resource may have made a model of this name. |
| `kind` | `string` | `object`, `vehicle`, `ped` or `weapon`. |
| `parent` | `string\|element` | A model of the same kind (by name, or a `model` element) whose model info the new one copies: handling, vehicle type, frames, txds, flags. Required for every kind but `object`. *(default: `nil`)* |

## Returns

The new `model` element. Raises an error if the arguments are wrong or the model could not be made.

Until `engineSetModelDrawable` and `engineSetModelCol` give it files, a model with a parent draws and collides as its parent does. Destroying the element or stopping the resource removes the model, and the elements using it are destroyed with it. The server never learns of it.

## Example

```lua
local model = engineCreateModel("u6car", "vehicle", "infernus")
engineSetModelDrawable(model, engineLoadDrawable("models/u6car.kdr"))
engineSetModelCol(model, engineLoadCol("models/u6car.kbn"))
```

### Coming from MTA

Takes the place of MTA's `engineRequestModel`: the model gets a name instead of a free id.

## See also

- [engineSetModelDrawable (Client)](https://wiki.mymp.gg/en/engineSetModelDrawable.md): Makes a model draw a drawable loaded with engineLoadDrawable instead of its own.
- [engineSetModelCol (Client)](https://wiki.mymp.gg/en/engineSetModelCol.md): Makes a model collide with a collision loaded with engineLoadCol instead of its own.
- [engineGetModels (Client)](https://wiki.mymp.gg/en/engineGetModels.md): Lists the models this client knows, with where each comes from.
- [createObject (Client)](https://wiki.mymp.gg/en/createObject-client.md): Creates an object that exists on this client only.
