Hi, I was hoping to create an item that triggers the hero's normal attack on_using(). It's simple:
local item = ...
local game = item:get_game()
function item:on_created()
self:set_savegame_variable("stick")
self:set_assignable(true)
end
function item:on_using()
print("beep")
game:get_hero():start_attack() -- Normal sword attack
end
When I equip the item and press the button, the console outputs "beep", and then the player becomes frozen. The sword is not swung. From the console, I can unfreeze the player with: sol.main.game:get_hero():unfreeze().
Any clue why start_attack() isn't working here? I can call sol.main.game:get_hero():start_attack() from the console at any time and it works, but the same thing doesn't work inside this item script. Thanks!