brodock101
New member
Hi there. I'm try write script to npc on did hit. In script, when npc caller attack enemy, and if enemy not blocking then npc heals 10hp.
Where's my error?
Sorry for my englsih)
void main()
{
void NP = getlocalvar("self");
void target;
int i;
int iType;
int NoBlock;
int iHP = getentityproperty(NP, "health");
int iEnm = openborvariant("count_enemies");
for (i=0,i<iEnm, i++){
target = getentity(i);
iType = getentityproperty(target, "type");
NoBlock = getentityproperty(target, "animation");
if ((target = getentityproperty(NP, "opponent"))&&(iType == openborconstant("TYPE_ENEMY"))&&(NoBlock != openborconstant("ANI_BLOCK"))){
changeentityproperty(NP, "health", iHP+10);
}
}
}
Where's my error?
Sorry for my englsih)
void main()
{
void NP = getlocalvar("self");
void target;
int i;
int iType;
int NoBlock;
int iHP = getentityproperty(NP, "health");
int iEnm = openborvariant("count_enemies");
for (i=0,i<iEnm, i++){
target = getentity(i);
iType = getentityproperty(target, "type");
NoBlock = getentityproperty(target, "animation");
if ((target = getentityproperty(NP, "opponent"))&&(iType == openborconstant("TYPE_ENEMY"))&&(NoBlock != openborconstant("ANI_BLOCK"))){
changeentityproperty(NP, "health", iHP+10);
}
}
}