Skip to content

Scripts for beginners.

User Avatar
#96
Auto-translated
The easiest way is to create a region of size 1x1 and write a trigger that activates when entering this region:

Trigger(REGION_ENTER_AND_STOP_TRIGGER,"region name","FName")

Where FName is the name of the function. And before that, what the function should actually do:

function FName(heroname)
if GetObjectOwner(heroname)==1 then
SetObjectiveState("quest name", OBJECTIVE_COMPLETED)
Trigger(REGION_ENTER_AND_STOP_TRIGGER,"region name",nil)
end;
end;

Inside the function, we first check the condition that heroname belongs to the first player (if the human player is the first, of course). Secondly, if the condition is met, we mark the quest as completed and cancel the trigger action so that it is no longer triggered.
 

К А
Стикеры GBF в Telegram