entity respawn event||doc135520

September 20, 2022

Format

 ENTITY_REBIRTH
  • The class to which the function belongs:Entity

Description

This event is fired when the entity respawns.


Context

The context content of the event

name type Description
obj1 Entity Reborn entity instance


Code Samples

On the server side of the entity templatemount script, register when the entity of this class is rebornCallbackbroadcast tipsthe name of the reborn entity

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