QuitGame
Leaves the server and closes the game - a menu’s Exit.
Works only in answer to a key: called from OnKey while the script holds the keyboard (SetKeyboardCapture), for a
key the player pressed. Anywhere else - a timer, an event from the server, a script that has not taken the keyboard - it
does nothing, so a script can offer the player a way out but never close their game on its own. The server sees an
ordinary disconnect.
Syntax
Section titled “Syntax”QuitGame()Returns
Section titled “Returns”nothing
Example
Section titled “Example”function OnKey(key, pressed) if pressed and key == "escape" and loginBoxShown then QuitGame() -- the login box's Exit endendSee also
Section titled “See also”SetKeyboardCapture · OnKey · the The game’s UI for a script group of the index
