kill object||doc135511

September 20, 2022

Format

 Entity:kill(from, cause) 
  • The class to which the function belongs:Entity

Description

Kill physical objects.


Parameters

Variable name type Description
from Entity Kill the source entity instance
cause strin Kill source description


Code Samples

On the server side of the entity templatemount script, add a register for when this type of entity is hit by a projectileCallback, kill the object

Trigger.RegisterHandler(this:cfg(), "ENTITY_HITTED", function(context)
    local entity = context.obj1
    local from = context.obj2
    entity:kill(from,'hit') 
end)