Steve Craft
Member
some days ago i made a dash script while it's working good and all i have one problem that i couldn't solve it at all,how do i make the key that i assigned for dash(which for testing is attack2) to dash without needing to press again,my problem is that the dash velocity only happen if i press attack2 twice instead of only holding one time like on Mega Man X's dash.
i already passed 2 hours that day trying to understand why it's having this problem and i still haven't found a way to solve it
that's my script,just know that i already tried other ways so "If(Pattack2) and performattack" was my last try,i already tried by using "com A2 freespecial" too
but the problem of having to press attack2 twice still exist,just explaining,my problem isn't speed or something,it's only having to press attack2 twice that is my issue
i already passed 2 hours that day trying to understand why it's having this problem and i still haven't found a way to solve it
Code:
void main()
{
int Player = getlocalvar("player");
void Self = getplayerproperty(Player, "entity");
int Direction = getentityproperty(Self, "direction");
void Animation = getentityproperty(Self, "animationID");
void frame = getentityproperty(Self, "animpos");
void PLeft = playerkeys(Player,1,"moveleft");
void PRight = playerkeys(Player,1,"moveright");
void NotPLeft = playerkeys(Player,2,"moveleft");
void NotPRight = playerkeys(Player,2,"moveright");
void NeverPLeft = playerkeys(Player,0,"moveleft");
void NeverPRight = playerkeys(Player,0,"moveright");
void PSpecial = playerkeys(Player,1,"Special");
void NotPSpecial = playerkeys(Player,2,"Special");
void PAttack = playerkeys(Player,1,"attack");
void Pattack2 = playerkeys(Player,1,"attack2");
void Pattack3 = playerkeys(Player,1,"attack3");
void Pattack4 = playerkeys(Player,1,"attack4");
void NotPAttack = playerkeys(Player,2,"attack");
void NotPAttack2 = playerkeys(Player,2,"attack2");
void NotPAttack3 = playerkeys(Player,2,"attack3");
void NotPAttack4 = playerkeys(Player,2,"attack4");
if(Animation == openborconstant("ANI_JUMP") ){ //Moving in the Air
if(NotPLeft || NotPRight){
if(NeverPLeft || NeverPRight){
changeentityproperty(Self, "velocity", 0);
}
} else if(PLeft){
changeentityproperty(Self, "velocity", -1);
changeplayerproperty(Self, "playkeys", 0);
} else if(PRight){
changeentityproperty(Self, "velocity", 1);
changeplayerproperty(Self, "playkeys", 0);
}
}
if(Pattack2){
performattack(Self, openborconstant("ANI_FREESPECIAL")); //Dash in ground
}
if(frame == 1 && Direction != 0){
changeentityproperty(Self, "velocity", 1.5);
changeplayerproperty(Self, "playkeys", 0);
}
if(frame == 1 && Direction != 1){
changeentityproperty(Self, "velocity", -1.5);
changeplayerproperty(Self, "playkeys", 0);
}
if(frame == 2){
changeentityproperty(Self, "velocity", 0);
}
if(frame == 1 && NotPAttack2){
updateframe(Self, 2);
changeentityproperty(Self, "velocity", 0);
}
}
but the problem of having to press attack2 twice still exist,just explaining,my problem isn't speed or something,it's only having to press attack2 twice that is my issue