Bruce
Active member
Hello everyone,
Can someone take a look at this?
I am trying to setup the counters using onpainscript for the boss entities to prevent players from spamming.
OnPainScript:
performattack never triggers because getlocalvar("attacktype") gives the result of #0 instead of 0.
Since openborconstant("ATK_NORMAL") is 0. Therefore, the if condition is never met.
I am using this attack x x x x x x x x x x in the animations of the boss's entity.
samething happens to attack2 x x x x x x x x x x and so on
I've tried it with OnFallScript which it is working fine.
getlocalvar("attacktype" functions seems to give the wrong result in the onpainscript, not in the OnFallScript.
I am using Kartus's version because of the bug I reported here:
What causes the stage not to end after the certain boss is defeated?
Thank you so much
Can someone take a look at this?
I am trying to setup the counters using onpainscript for the boss entities to prevent players from spamming.
OnPainScript:
Code:
void AttackType = getlocalvar("attacktype"); // Get attack type
void self = getlocalvar("self"); // Caller
int random = rand()%50; // RANDOM -49 to 49,
if(random < 0)
{ random = random * -1; }
if(AttackType == openborconstant("ATK_NORMAL"))
{
if(getentityvar(self, "Spawn_Pain_Counter") > random)
{
performattack(self, openborconstant("ANI_block"));
}
}
performattack never triggers because getlocalvar("attacktype") gives the result of #0 instead of 0.
Since openborconstant("ATK_NORMAL") is 0. Therefore, the if condition is never met.
I am using this attack x x x x x x x x x x in the animations of the boss's entity.
samething happens to attack2 x x x x x x x x x x and so on
I've tried it with OnFallScript which it is working fine.
getlocalvar("attacktype" functions seems to give the wrong result in the onpainscript, not in the OnFallScript.
I am using Kartus's version because of the bug I reported here:
What causes the stage not to end after the certain boss is defeated?
Thank you so much