Player logout event||doc135599

September 20, 2022

Format

 ENTITY_LEAVE
  • The class to which the function belongs:Player

Description

This event is fired when the player logs out.


Context

The context content of the event

name type Description
obj1 Player The logged out player entity instance


Code Samples

On the server side of the player entity templatemount script, when a registered player logs outCallbackbroadcast tipsthe player's name

Trigger.RegisterHandler(this:cfg(), "ENTITY_LEAVE", function(context)
    local player = context.obj1
    World.CurWorld.SystemNotice(1, player.name, 40)    --Broadcast entity name
end)