Auto-translated
Help me, kind people, with another script.
The idea is that initially, only the second player should be able to pass through the garrison, and under certain conditions, the first player should also be able to.
But the script doesn't work from the very beginning.
If you write in MapScript:
SetObjectEnabled("Garnizon_1", nil);
print("garrison disabled");
and then:
function Garrison_1_Block_F()
SetObjectEnabled("Garnizon_1", true);
sleep(1);
print("garrison enabled");
sleep(1);
end;
Trigger(OBJECT_TOUCH_TRIGGER, "proba", "Garrison_1_Block_F");
- then everything works fine.
But if you write:
SetObjectEnabled("Garnizon_1", nil, 1, 3, 4, 5, 6, 7, 8); ---or false, I tried
print("garrison disabled");
function Garrison_1_Block_F()
SetObjectEnabled("Garnizon_1", true, 1);
sleep(1);
print("garrison enabled for the first player");
sleep(1);
end;
Trigger(OBJECT_TOUCH_TRIGGER, "proba", "Garrison_1_Block_F");
- then the garrison is disabled for the second player as well, and it doesn't turn on for the first player either.
As always, what am I doing wrong?
And specifically, how do I disable the garrison from the very beginning for everyone except the second player?