Originally Posted by HailTheMoons
So if I do :
Lua Code:
ZO_PreHook("ArePlayerWeaponsSheathed", myAddon.ToggleWeaponsSheathed())
it will trigger when ArePlayerWeaponsSheathed changes (and work even out of combat), and execute my function who write in the chat (myAddon.ToogleWeaponsSheathed) ?
I changed my code, but it's still not working as intended.
Do you know some add-on which use this ? I searched in my add-ons but found none with this function (even the "SheathWeapon" add-on use RegisterForUpdate() ! )
Thanks a lot for all the help you give me,
|
ArePlayerWeaponsSheathed is an info function. It doesn't change the sheath weapon state, it just tells you if they are sheathed or not. You want to do:
ZO_PreHook("TogglePlayerWield", myAddon.ToggleWeaponsSheathed())