M MY Multiplayer: Wiki
Side
Kind

onShutdown

ServerEvent

Fired when a script calls shutdown, right before the server shuts down.

addEventHandler("onShutdown", root, function(element resource, string reason) … end)

Handler parameters

NameTypeDescription
resourceelementThe root element of the resource that called shutdown.
reasonstringThe reason given to shutdown.

Source

The root element (root).

Example

addEventHandler("onShutdown", root, function(resource, reason)
    dbExec(db, "INSERT INTO server_log (event, detail) VALUES (?, ?)", "shutdown", reason)
end)

See also