witch hut script help
I am working on a map and I would like to place a witch hut that always gives Logistics. I checked the manual and looked at scripts in several other maps and came up with this little script (nothing else is in the script window, in the object properties of the witch hut under "(ab)Name" I put "witch"):
function WitchHut()
GiveHeroSkill(heroname, 1);
print('The witch taught ',heroname,' a skill.');
SetObjectEnabled('witch', false);
MarkObjectAsVisited('witch', heroname);
Trigger(OBJECT_TOUCH_TRIGGER, 'witch', 'WitchHut');
end;
Trigger(OBJECT_TOUCH_TRIGGER, 'witch', 'WitchHut');
Unfortunately it doesn't work, the witch hut still gives a random skill. Anyone can help and point out what's missing or wrong?
Thanks a lot
|