Set respawn location||doc135508

September 20, 2022

Format

 Entity:setRebirthPos(pos, map)
  • The class to which the function belongs:Entity

Description

Set respawn coordinates.


Parameters

Variable name type Description
pos Vector3 respawn coordinates
map Map Respawn map, the default is the map where the entity is located


Code Samples

On the server side of the entity templatemount script, add the registration of this type of entity when logging into the gameCallback, which sets the entity's respawn point

Trigger.addHandler(this:cfg(), "ENTITY_ENTER", function(context)
    local entity = context.obj1
    entity:setRebirthPos(Lib.v3(0, 0 ,0))
end)