Solved spawn ani with choose health amount

Question that is answered or resolved.

Gurtag

Member
hey guys i have frankesteined this script, i still strugle to understand the basics of it.. i am terrible at undestanding its logic . . anyway since i cant get it to work i wanted to ask for help...
my idea is to spawn say entity in follow# and with diferent health that its standard one, it get spawned fine and in follow# as intended but the health doesnt seem to work...

this is my code so far

Code:
void spawnhealthani(void vName, float fX, float fY, float fZ, int maxhealth, void Ani)
{
    void self = getlocalvar("self");
    void vSpawn;
    int  iDirection = getentityproperty(self, "direction");

    clearspawnentry();
      setspawnentry("name", vName);

    if (iDirection == 0){               
          fX = -fX;
    }

      fX = fX + getentityproperty(self, "x"); //Get X location and add adjustment.
      fY = fY + getentityproperty(self, "a"); //Get Y location and add adjustment.
      fZ = fZ + getentityproperty(self, "z"); //Get Z location and add adjustment.
    
    vSpawn = spawn();

    changeentityproperty(vSpawn, "position", fX, fZ, fY);
    changeentityproperty(vSpawn, "direction", iDirection);
    changeentityproperty(vSpawn, "maxhealth", maxhealth);
    performattack(vSpawn, openborconstant(Ani));
  
    return vSpawn;
}
 
Solution
got it to work.. this is the working code..

Code:
void spawnhealthani(void vName, float fX, float fY, float fZ, int Health, void Ani)
{
    void self = getlocalvar("self");
    void vSpawn;
    int  iDirection = getentityproperty(self, "direction");

    clearspawnentry();
      setspawnentry("name", vName);

    if (iDirection == 0){               
          fX = -fX;
    }

      fX = fX + getentityproperty(self, "x"); //Get X location and add adjustment.
      fY = fY + getentityproperty(self, "a"); //Get Y location and add adjustment.
      fZ = fZ + getentityproperty(self, "z"); //Get Z location and add adjustment.
    
    vSpawn = spawn();

    changeentityproperty(vSpawn, "position", fX, fZ, fY);
    changeentityproperty(vSpawn...
got it to work.. this is the working code..

Code:
void spawnhealthani(void vName, float fX, float fY, float fZ, int Health, void Ani)
{
    void self = getlocalvar("self");
    void vSpawn;
    int  iDirection = getentityproperty(self, "direction");

    clearspawnentry();
      setspawnentry("name", vName);

    if (iDirection == 0){               
          fX = -fX;
    }

      fX = fX + getentityproperty(self, "x"); //Get X location and add adjustment.
      fY = fY + getentityproperty(self, "a"); //Get Y location and add adjustment.
      fZ = fZ + getentityproperty(self, "z"); //Get Z location and add adjustment.
    
    vSpawn = spawn();

    changeentityproperty(vSpawn, "position", fX, fZ, fY);
    changeentityproperty(vSpawn, "direction", iDirection);
    changeentityproperty(vSpawn, "maxhealth", Health);
    changeentityproperty(vSpawn, "health", Health);
    performattack(vSpawn, openborconstant(Ani));
  
    return vSpawn;
}
 
Solution
Back
Top Bottom