void startlop()
{ 
    void self = getlocalvar("self");
    setlocalvar("total", 1);



}



void endlop(int framenumber, int repeats)
{

void self = getlocalvar("self"); 
int total = getlocalvar("total");
 


	if(total<=repeats)
	{
		
                        setlocalvar("total", total+1);
			updateframe(self, framenumber-1);
		
	}

        else
        {
          NULL();
        }
}




void startloop()
{ 
    void self = getlocalvar("self");
    int animpos = getplayerproperty(self, "animpos");
    setlocalvar("frame", animpos);
}




void endloop(int repeats)
{

void self = getlocalvar("self"); 
int total = getlocalvar("total");
int frame = getlocalvar("frame");


	if(total<=repeats)
	{
		
                        setlocalvar("total", total+1);
			updateframe(self, frame);
		
	}

        else
        {
          NULL();
        }
}


void loopvar()
{ 
    void self = getlocalvar("self");
    setlocalvar("total", 1);



}



void press()
{


    void self     = getlocalvar("self");
    int iPIndex   = getentityproperty(self,"playerindex"); //Get player index
    void attack   = playerkeys(iPIndex, 0, "attack"); // "Attack" pressed.
    void special  = playerkeys(iPIndex, 0, "special");

    if (!attack)

         {
       changeentityproperty(self, "animation", openborconstant("ANI_idle")); //Shoot!
         }
   



}


void spress()
{


    void self     = getlocalvar("self");
    int iPIndex   = getentityproperty(self,"playerindex"); //Get player index
    void attack   = playerkeys(iPIndex, 0, "attack"); // "Attack" pressed.
    void special  = playerkeys(iPIndex, 0, "special");

    if (!special)

         {
       changeentityproperty(self, "animation", openborconstant("ANI_idle")); //Shoot!
         }
   



}







