Reply to Re: Immunity to Certain Weapons?
If you don't have an account, just leave the password field blank.
Through testing this, I've noticed that if you punch the target too fast it can be locked in at 0 hitpoints. To avoid this, spawning another script to wait() and reset the hitpoints should do the trick.
You should also check for &missle_source as well so your projectile spells will be effective even when fists are equipped.
//enemy script
void hit ()
{
if (&cur_weapon == 1)
{
if (&missle_source == 1)
{
&save_x = ¤t_sprite;
&save_y = sp_hitpoints(¤t_sprite,-1);
spawn("script");
}
}
}
//spawned script
void main ()
{
int &en = &save_x;
int &hp = &save_y;
sp_hitpoints(&en,0);
wait(1);
wait(1);
sp_hitpoints(&en,&hp);
}
You should also check for &missle_source as well so your projectile spells will be effective even when fists are equipped.
//enemy script
void hit ()
{
if (&cur_weapon == 1)
{
if (&missle_source == 1)
{
&save_x = ¤t_sprite;
&save_y = sp_hitpoints(¤t_sprite,-1);
spawn("script");
}
}
}
//spawned script
void main ()
{
int &en = &save_x;
int &hp = &save_y;
sp_hitpoints(&en,0);
wait(1);
wait(1);
sp_hitpoints(&en,&hp);
}