Keyscript Issue with Multi-Tap Action (Jump and Special Keys)

maxman

Well-known member
I am having trouble with both tapping 2-3 buttons and jumping. I have jump set with up key. I set jump and special keys with keyscript as a multi-tap attack. I have no problem with tapping attack and attack2 buttons and I can jump. But when I press jump and special keys at the same time, I cannot jump at all. Every time I press any button (both action and directional buttons) after that problem, the character performs a special move (follow animation). I cannot jump or do anything right after I pressed them. Even when I walk, and then release, it performs the same.

Code:
#define glv getlocalvar
#define slv setlocalvar
#define gev getentityvar
#define sev setentityvar
#define ggv getglobalvar
#define sgv setglobalvar
#define giv getindexedvar
#define siv setindexedvar
#define gep getentityproperty
#define gpp getplayerproperty
#define oc openborconstant
#define ov openborvariant
#define cep changeentityproperty
#define cpp changeplayerproperty
#define cov changeopenborvariant
#define pa performattack
#define pk playerkeys

void main(){
	void index = glv("player"); // Calling player
	void self = gpp(index, "entity"); //Defining a player as an entity
	void vAniID = gep(self, "animationid"); // Calling animation
	
	//Vacant presses
    float LP = gev(self, "LP");
    float MP = gev(self, "MP");
    float SP = gev(self, "SP");
    float LK = gev(self, "LK");
    float MK = gev(self, "MK");
    float SK = gev(self, "SK");
	
	//PRESSES
	int attack = pk(index, 1, "attack");
	int attack2 = pk(index, 1, "attack2");
	int jump = pk(index, 1, "jump");
	int special = pk(index, 1, "special");
	int attack3 = pk(index, 1, "attack3");
	int attack4 = pk(index, 1, "attack4");
	
	int fightStarted = giv("fightStarted");
	
	if(fightStarted){
		
    if(attack){
      if(LP == NULL()){
        LP = ov("elapsed_time");
        sev(self, "LP", LP);
      }
    }

    if(LP <= ov("elapsed_time") - 15){
      LP = NULL();
      sev(self, "LP", NULL());
    }
	
    if(attack2){
      if(MP == NULL()){
        MP = ov("elapsed_time");
        sev(self, "MP", MP);
      }
    }

    if(MP <= ov("elapsed_time") - 15){
      MP = NULL();
      sev(self, "MP", NULL());
    }
	
    if(jump){
      if(LK == NULL()){
        LK = ov("elapsed_time");
        sev(self, "LK", LK);
      }
    }

    if(LK <= ov("elapsed_time") - 15){
      LK = NULL();
      sev(self, "LK", NULL());
    }

    if(special){
      if(MK == NULL()){
        MK = ov("elapsed_time");
        sev(self, "MK", MK);
      }
    }

    if(MK <= ov("elapsed_time") - 15){
      MK = NULL();
      sev(self, "MK", NULL());
    }
	
    if(LP != NULL() && MP != NULL()){
    //  if(vAniID != oc("ANI_IDLE") || vAniID != oc("ANI_WALK") || vAniID != oc("ANI_BACKWALK")){ 
        pa(self, oc("ANI_FREESPECIAL30"));
    //  }
    }
	
    if(LK != NULL() && MK != NULL()){
    //  if(vAniID != oc("ANI_IDLE") || vAniID != oc("ANI_WALK") || vAniID != oc("ANI_BACKWALK")){ 
        pa(self, oc("ANI_FOLLOW31"));
    //  }
    }
}
 
Back
Top Bottom