Skip to content
User Avatar
#2946
Auto-translated
Jewill
Hello forum again. Maybe someone can tell me how to add one to a variable? I mean, I'm running a loop with a check to see if my variable has changed by "+1" (in my case, this is GetHeroLevel). However, the game doesn't react at all, as if there's a syntax error.

In general, to add one:
a = a + 1

In the case of a loop checking the level, I would do it like this:

a = 1;
while 1 do
sleep(2);
if GetHeroLevel(hero) - a == 1 then
...
end
sleep(2);
a = GetHeroLevel(hero);
end

And for this purpose, there is:
Trigger(HERO_LEVELUP_TRIGGER, hero, function)

Statistics

Welcome our newest member: artem

Users Online 2 users 1919 guests