Surface clone area will trigger on_entity_cloned.
if the origina entity which i used for a door or portal. I need listen this event to compare a cache table to find the cloned entity.
doors, a cache table , store all door entities unit_number => door entity
Code: Select all
script.on(...on_entity_cloned, function(e)
... find e.source in doors if exists that mean a door entity
e.destination will be cloned new door entity
end )
If entity has a private field for moder storing plain data, that will be more effcient for this targeting.
when create door, set entity.private_field = unique_id_with_a_role_tag
1. first method, searching in the cloned area with same private_field value
2. second method, on_entity_cloned, only identify this private_field value to determine if its' a door entity.