![]() |
Running Attack
Hey, I ran into a problem where I have weapon that's supposed to be allowing the player to use a sword gani while walking, basically pressing two keys at once (walking dir key, s key for attacking). Here's part of the script, which is triggered from a timeout:
PHP Code:
|
1. You have to use == to check for equality, one = is for assigning a value.
2. Your code is impossible to debug without the 'bigger' picture (the code that's responsible for calling onWalkCheck()). 3. Please use PHP tags instead, and style your code properly when you post it. You can use my beautifier to do that for you: http://fp4.ca/gs2beautifier |
fixed the style and syntax errors. Here is the timeout
PHP Code:
|
I think your best bet is to replace the walking gani while the player is attacking, and then set it back to the walking gani when the player is done their attack.
I.e: PHP Code:
|
We replaced the gani under the Attack function, which supprisingly resulted in the gani being replaced at all times.. That's kinda an issue, but here's what we have:
PHP Code:
|
Quote:
In case yes, you shouldn´t use sleep() in a timeout |
If you press the key 'S', then the Attack function is triggered. There is no timeout used here. I am just using replaceani, then a sleep which would generally be as long as the attack gani is, then replace the gani back to normal. The player chat is there so I could see that it works.
|
Quote:
PHP Code:
|
| All times are GMT +2. The time now is 06:32 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.