Player login event||doc135598

September 20, 2022

Format

 ENTITY_ENTER
  • The class to which the function belongs:Player

Description

This event is fired when the player logs in.


Context

The context content of the event

name type Description
obj1 Player The logged in player entity instance


Code Samples

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

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