Added 9 hours 0 minutes ago
I figured it out. Initially, the town was random, and I wrote the following script:
function town_nameF()
void =TransformTown("town_name",0)
RazeTown("town_name");
Trigger(OBJECT_CAPTURE_TRIGGER,"town_nameF",nil);
end;
Trigger(OBJECT_CAPTURE_TRIGGER,"town_name","town_nameF",nil);
In the editor, I set the destruction model for this town, and the hero who captures it does not die.