07.10.2016, 09:08
How can I actually trigger something by using an animation, for example "S_1HATTACK" to print whenever it is used?
![[Image: ?ip=193.70.2.209&port=27960&obrazek=4f73...e608b8.jpg]](http://gothic-online.com.pl/tracker/?ip=193.70.2.209&port=27960&obrazek=4f73c04528050d2f3098b80600e608b8.jpg)
onAnimation
|
07.10.2016, 09:08
How can I actually trigger something by using an animation, for example "S_1HATTACK" to print whenever it is used?
![]()
07.10.2016, 12:18
onAnimation + getAnimationName()
07.10.2016, 14:13
function onAnimation()
{ local anim = getAnimationName(); if (anim == S_1HATTACK) { print("HIT"); } } doesnt seem to work ![]()
07.10.2016, 14:35
Why doesn't it work? Do you get an error-message? In any case: It should be "S_1HATTACK". You're probably missing the quotationmarks.
07.10.2016, 15:26
Of course he missing "" and onAnimation body has argument aniId.
Well yes I was missing it but I tried with quotations mark before, ok so I need animation ID. To get it I should use getAnimationID yup?
so, for instance function onCommand(cmd, params) { if(cmd == "use") { local anim = getAnimationID("T_LEGSHAKE"); print(anim); } } why this command shows me, depending on what I do, different values? ...........................................................EDIT ALERT I dont know if this function works correctly so I made timer setTimer(function() { local aniID = getAnimationID(); print(aniID); }, 200, true); and it shows me that the ID is 68 however function onAnimation() { local aniID = getAnimationID(); if (aniID == 68) { print("HIT"); } } is not working ![]() Squirrel Script
or better Squirrel Script
Please use [code].
Bimbol. you are sure that the animation work? I tried to show getPlayerAni (pid) or getPlayerAni (heroId) and it does not work playAni (string) also I have the latest version of the client and the server .... translated by google
![]() ehh ok if he runs again, it means that I have something wrong |
« Next Oldest | Next Newest »
|