OperatorMopa
Member
- Joined
- Feb 10, 2014
- Messages
- 127
- Reaction score
- 6
Hello, I have a problem with my script.
I need to execute one lua function when character attacks creature OR character equips item with specified ID.
I've tried with onEquip function and it works ( lua function executes ) but there is a bug - getWeapon() in c++ returns 0 (as if there were NO WEAPON). I think that it's caused by onEquip(), becouse when im using same lua funcion as a creaturescript onLogin() it works perfect, and getWeapon() in c++ returns everything fine.
So i decided to try with something else - execute lua function when character target/attack creature, but there is no onAttack() function in TFS 1.2.
Do you know any other solutions instead of writing own cpp function ?
I need to execute one lua function when character attacks creature OR character equips item with specified ID.
I've tried with onEquip function and it works ( lua function executes ) but there is a bug - getWeapon() in c++ returns 0 (as if there were NO WEAPON). I think that it's caused by onEquip(), becouse when im using same lua funcion as a creaturescript onLogin() it works perfect, and getWeapon() in c++ returns everything fine.
So i decided to try with something else - execute lua function when character target/attack creature, but there is no onAttack() function in TFS 1.2.
Do you know any other solutions instead of writing own cpp function ?