<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [server](./server.md) &gt; [Player](./server.player.md) &gt; [disconnect](./server.player.disconnect.md)

## Player.disconnect() method

Disconnects the player from the game server.

Use for: kicking a player or enforcing a logout. Do NOT use for: switching worlds; use `Player.joinWorld` instead.

\*\*Side effects:\*\* Emits `PlayerEvent.LEFT_WORLD` if the player is in a world and closes the connection.

\*\*Category:\*\* Players

**Signature:**

```typescript
disconnect(): void;
```
**Returns:**

void

