M MY Multiplayer: Wiki
Side
Kind

shutdown

Server

Shuts the server down. It fires onShutdown first.

bool shutdown([string reason = "No reason specified", int exitCode = 0])

Parameters

NameTypeDescription
reasonstringThe reason, which goes to the log and to onShutdown.default "No reason specified"
exitCodeintThe process's exit code, useful to a script that restarts the server.default 0

Returns

true.

Example

addCommandHandler("restartserver", function(player)
    shutdown("Restart requested by " .. getPlayerName(player), 1)
end)

See also