Повторю текст ошибки:
(Script) ERROR: Objective "obj" is active, so can only complete or fail it
С аm, я думаю, это мало связано, особенно с тем местом, где ты изменил.
Первоначальный вариант от Нивала:
function am()
while 1 do
local heroes = GetPlayerHeroes(PLAYER_1);
local count = 0
h = "Maahir";
if HasArtefact(h, ARTIFACT_RING_OF_MAGI) then
count = count + 1;
end;
if HasArtefact(h, ARTIFACT_CROWN_OF_MAGI) then
count = count + 1;
end;
if HasArtefact(h, ARTIFACT_ROBE_OF_MAGI) then
count = count + 1;
end;
if HasArtefact(h, ARTIFACT_STAFF_OF_MAGI) then
count = count + 1;
end;
if count < 4 then
SetObjectiveState("obj1", OBJECTIVE_ACTIVE);
startThread (objective_1);
end;
sleep(3);
end;
end;