Skip to content

Scripts for beginners.

User Avatar
#149
Auto-translated
function replacecreature() while 1 do if GetHeroCreatures("Sarge", CREATURE_ARCHER) >= 1 and GetTownBuildingLevel("cheast_town", TOWN_BUILDING_DWELLING_2) == 2 then RemoveHeroCreatures("Sarge", CREATURE_ARCHER, 9999); AddHeroCreatures("Sarge", CREATURE_LONGBOWMAN, 1); end; sleep(4); end; end; startThread(replacecreature); Is this how it should be?
for one, I accidentally revealed the mod I'm trying to put together
You've piqued my interest... --- However, the code I wrote has a weak point. I suspect you don't actually have 9999 archers. It will throw an error. You need to check the exact number of archers and subtract that exact number! If the goal is to have no more of them in the army. But for now, check it without subtracting the archers.
 

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

Statistics

Welcome our newest member: artem

Users Online 1 users 1583 guests