# createPed (Server)

> Creates a ped on the server, seen by every player.

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

## Syntax

```lua
ped|false createPed(string model, float x, y, z [, float rotation = 0])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `model` | `string` | The ped model's name, such as `male01`. |
| `x, y, z` | `float` | Position in the world, or a vec3. |
| `rotation` | `float` | Rotation in degrees around the Z axis. *(default: `0`)* |

## Returns

The created ped, or `false` if the model is not a ped model.

The ped is placed under the dynamic element of the resource that created it and starts with 100 health.

## Example

```lua
local guard = createPed("male01", 1481.0, -1771.0, 18.8, 180)
giveWeapon(guard, "PISTOL", 60, true)
```

## See also

- [createPed (Client)](https://wiki.mymp.gg/en/createPed-client.md): Creates a ped that exists on this client only.
- [giveWeapon (Server)](https://wiki.mymp.gg/en/giveWeapon.md): Gives a weapon with ammo to a ped or player.
- [warpPedIntoVehicle (Shared)](https://wiki.mymp.gg/en/warpPedIntoVehicle.md): Puts a ped or player straight into a vehicle seat, with no animation.
- [setPedArmour (Server)](https://wiki.mymp.gg/en/setPedArmour.md): Sets the armour of a ped or player and sends it to the clients.
