The specified player quits the game||doc135778

September 20, 2022

Format

 Game.Exit(player) 
  • The class to which the function belongs:Game

Description

Quit the specified player from the game


Precautions

  • When the client calls this function, the player may not be specified

Parameters

Variable name type Description
player Player player instance


Code Samples

On the server side of the player entity templatemount script, when the registered player diesCallback, which drops the player from the game

Trigger.RegisterHandler(this:cfg(), "ENTITY_DIE", function(context)
    local player = context.obj1
     Game.Exit(player) 
end)