I would write it using auxiliary values. For example, at the very beginning of the map, I would place:
a = 0;
In the second trigger, I would add a check:
if a == 1 then
Your function
Trigger reset
else
if a == 0 then
Text: You have not visited the first hut
end;
end;
And in the first hut, write your function, and at the end add:
a = 1;
If it's not clear, I can write a detailed template later.
Thank you very much, I didn't know that was possible. I'll try to do it, and if it doesn't work, I'll definitely ask you for advice.