# spawnPlayer (Server)

> Places the player in the world, with health at 100, no armour, in interior 0 and with no weapons.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Server
- **Category**: Players and accounts
- **URL**: https://wiki.mymp.gg/en/spawnPlayer

## Syntax

```lua
bool spawnPlayer(player player, float x, y, z [, float rotation = 0, string model = male01])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `player` | `player` | The player. |
| `x, y, z` | `float` | The position in the world. |
| `rotation` | `float` | The direction they face, in degrees. *(default: `0`)* |
| `model` | `string` | The ped model's name. *(default: `male01`)* |

## Returns

`true` if the player spawned, `false` if the element is not a player, the model is not a ped model or the position is not valid.

Fires `onPlayerSpawn` on the player.

## Example

```lua
addEventHandler("onPlayerJoin", root, function()
    spawnPlayer(source, 2495.1, -1687.4, 13.5, 90, "male01")
end)
```

### Coming from MTA

The model is given by the ped model's name, not a skin id, and there are no interior, dimension or team parameters.

## See also

- [isPlayerSpawned (Server)](https://wiki.mymp.gg/en/isPlayerSpawned.md): Tells whether the player has been placed in the world by spawnPlayer.
- [onPlayerSpawn (Server)](https://wiki.mymp.gg/en/onPlayerSpawn.md): Fired after spawnPlayer spawns a player.
- [setElementPosition (Shared)](https://wiki.mymp.gg/en/setElementPosition.md): Moves an element to a position in the world.
