The game doesn't throw any errors, the console is clean, but the script doesn't work. Any ideas where to look?
For example,
startThread. Outside the function.The second problem is that your function will only run once. To make the game constantly check something, create a loop inside, an infinite one:
while 1 do
end;But don't forget to add
sleep, otherwise the game will freeze.GetHeroLevel(TownStrongholdHero1) == 3Only for one hero? It would be better to search for all heroes of the stronghold on the map, probably. Also, there's a problem: if this hero dies, the function will crash with an error. You need to check
IsHeroAlive.And ideally, add a
break after the skill is acquired, to exit the loop.If the goal is to wait for the level to reach 3, you can use a trigger instead of an infinite loop; there seems to be a level-up condition there, so check it out.
P.S. Yes, scripts are like that. What did you expect? )