Solved Keyscript attack then return to idle

Question that is answered or resolved.

kimono

Well-known member
Hi, I try to input an attack 3 button that activates a freespecial. It works partially, my only problem is that the character stay in freespecial and not return to idle.
Here's my small part of code (I'm still learning :) ):

Code:
void main()
{
    int iPlIndex = getlocalvar("player"); //Get calling player
    void vSelf = getplayerproperty(iPlIndex , "entity"); //Get calling entity
    void vAniID = getentityproperty(vSelf,"animationID"); //Get current animation ID
    void vAniPos = getentityproperty(vSelf, "animpos"); //Get current animation frame
    int iDir = getentityproperty(vSelf, "direction");  //Get current facing direction

    void iLeft = playerkeys(iPlIndex, 1, "moveleft"); // New key status of "Left"
    void iRight = playerkeys(iPlIndex, 1, "moveright"); // New key status of "Right"
    void iJump = playerkeys(iPlIndex, 1, "jump"); //New key status of "Jump"
    void iAttack = playerkeys(iPlIndex, 1, "attack"); //New key status of "Attack"
    void iAttack3 = playerkeys(iPlIndex, 1, "attack3"); //New key status of "Attack3"
    void iAttack4 = playerkeys(iPlIndex, 1, "attack4"); //New key status of "Attack4"

    void iLeftR = playerkeys(iPlIndex, 2, "moveleft"); // Release status of "Left"
    void iRightR = playerkeys(iPlIndex, 2, "moveright"); // Release status of "Right"

// attack3	
if(vAniID == openborconstant("ANI_IDLE")){
      if(playerkeys(iPlIndex, 0, "attack3")){ //Attack3 button is held?
            performattack(vSelf, openborconstant("ANI_FREESPECIAL"));
	 }	
    }
}
Any idea to return to normal state after performing anim freespecial?
 
danno: Yes if loop 0 infreespecial, the player stays in the last frame of the anim; if loop 1 the freespecial continues to play with no end.
The demo for testing purpose:
https://drive.google.com/file/d/1b0AOs4AIoRQzU8xVK_4_KiCl_tKFn8oP/view?usp=sharing
 
something is bugged in keyfly because from staring position attack3 works but as soon as keyfly is used it bugs out.  :o
 
Thank you danno, I resolved this by using
Code:
@cmd	beidle
in the last frame of the freespecial but I think something is wrong with my coding in keyscript.
 
Back
Top Bottom