# createObject (Server)

> Creates an object every player sees.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Server
- **Category**: Objects
- **URL**: https://wiki.mymp.gg/en/createObject-server
- **Counterpart**: Also exists on the client, with its own implementation: [createObject (Client)](https://wiki.mymp.gg/en/createObject-client.md)

## Syntax

```lua
object|false createObject(string model, float x, y, z [, float rx, ry, rz = 0, 0, 0])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `model` | `string` | The model's name, case-insensitive. |
| `x, y, z` | `float` | The position in the world. A `vec3` also works. |
| `rx, ry, rz` | `float` | The rotation in degrees. A `vec3` also works. *(default: `0, 0, 0`)* |

## Returns

The created object, or `false` if the model does not exist.

The object goes away when the resource that created it stops.

## Example

```lua
local ramp = createObject("cj_ramp1", 1480.0, -1740.0, 13.5, 0, 0, 180)
setObjectScale(ramp, 2)
```

## See also

- [createObject (Client)](https://wiki.mymp.gg/en/createObject-client.md): Creates an object that exists on this client only.
- [moveObject (Shared)](https://wiki.mymp.gg/en/moveObject.md): Moves an object smoothly to a position, turning it along the way.
- [setObjectScale (Shared)](https://wiki.mymp.gg/en/setObjectScale.md): Changes an object's size, evenly or along each axis.
- [destroyElement (Shared)](https://wiki.mymp.gg/en/destroyElement.md): Destroys an element and all of its children. Before it goes, each one fires onElementDestroy on the server or onClientElementDestroy on the client.
