Skip to content

server.configure

Changes server options for this gamemode. Call it once, when the gamemode starts.

server.configure(options: { spawnTimeout?: "allow" | "hold"; dispatchMode?: "session" | "global" }): void
Name Type Description
options.spawnTimeout "allow" | "hold" What happens when a playerSpawnRequest isn’t answered within 5 seconds: allow (the default) spawns the player at the server’s spawn point, hold keeps them held until you call players.spawn.
options.dispatchMode "session" | "global" Only while the gamemode loads. session (the default): each player’s events and commands run in order, and one player’s slow handler does not hold up the others. global: every handler waits for the one before, as before 0.22; for gamemodes written that way. See async handlers.

Changing dispatch mode after readiness throws dispatch-mode-after-ready. See Async handlers.

Nothing.

A mode where nobody spawns without a choice.

gamemodes/teams.ts
import { server } from "nativemp";
server.configure({ spawnTimeout: "hold" });