Skip to content

Script your own server

A KCD:MP server runs one game mode — a Lua script that decides where players spawn, what chat does, which commands exist and what happens in the world. This is its reference.

Server API

The callbacks the world calls and the functions a mode calls back — players, chat and HUD, zones, events, state, doors, bans, the clock and the weather. Callbacks.

Client API

The kcd2mp table a client script gets: events to and from the mode, the replicated state bags. Overview.

Lua now, TypeScript next

Modes are Lua 5.4 today. The TypeScript tier is planned over the same surface; the code samples will carry both once it ships.