Auto-translated
Colleague Dyrman has thoroughly analyzed everything – in general, from the console line, it is clear that the error lies here: HERO_LEVEL_UP_TRIGGER ([Script warning!] Value was NIL when getting global with name 'HERO_LEVEL_UP_TRIGGER') – as they say, an extra space changes everything; he also provided the correct spelling of the trigger – HERO_LEVELUP_TRIGGER .