Auto-translated
Hello everyone. I've encountered a problem in the script:
```
function fon()
local day1;
while 1 do
if GetObjectiveState("zad5")==OBJECTIVE_ACTIVE then
day1=GetDate( ABSOLUTE_DAY ) + 2
while day1 >= GetDate( ABSOLUTE_DAY ) do
sleep(10);
end;
SetObjectiveState("dzad3", OBJECTIVE_ACTIVE);
break
end;
sleep(2);
end;
while 1 do
pfonix = GetHeroCreatures( "Main_Hero", CREATURE_PHOENIX);
if pfonix >= 5 then
SetObjectiveState("dzad3", OBJECTIVE_COMPLETED);
SetObjectiveState("dzad2", OBJECTIVE_FAILED);
break;
end;
end;
end
```
The game simply crashes when this script is executed. The script itself was inspired by a similar loop from the campaign for Markel. This entire structure should work. I'm not sure, but the problem might be related to its execution within a thread.