Reply to Re: Script Troubles
If you don't have an account, just leave the password field blank.
First, mark your enemy's hitpoints pretty high. Then,
where you see if (&klife < ) mark the hitpoints that you want it to REALLY have. For example
try this:
void hit( void )
{
oneloop:
int &klife = sp_hitpoints (¤t_sprite, -1);
if (&klife < 250)
{
freeze(1);
freeze(¤t_sprite
say("`%Put the talking here!", ¤t_sprite);
int &boom5 = create_sprite(&save_x, &save_y, 7, 167, 1);
sp_seq(&boom5, 167);
playsound(24, 22050, 0, 0, 0);
wait(200);
int &boom6 = create_sprite(&save_x, &save_y, 7, 167, 1);
sp_seq(&boom6, 167);
playsound(24, 22050, 0, 0, 0);
wait(200);
int &boom6 = create_sprite(&save_x, &save_y, 7, 167, 1);
sp_seq(&boom6, 167);
playsound(24, 22050, 0, 0, 0);
wait(200);
sp_active(¤t_sprite, 0);
sp_nodraw(¤t_sprite, 1);
sp_brain(¤t_sprite, 0);
spawn("your-script");
}
else
{
playsound(your_play_sound);
sp_target(¤t_sprite, 1);
}
NOTE: Your enemy's hitpoints must ALWAYS be higher than the hitpoints you actually want for it.
Hope that helps.
Please, inform, if I forgot something.
where you see if (&klife < ) mark the hitpoints that you want it to REALLY have. For example
try this:
void hit( void )
{
oneloop:
int &klife = sp_hitpoints (¤t_sprite, -1);
if (&klife < 250)
{
freeze(1);
freeze(¤t_sprite
say("`%Put the talking here!", ¤t_sprite);
int &boom5 = create_sprite(&save_x, &save_y, 7, 167, 1);
sp_seq(&boom5, 167);
playsound(24, 22050, 0, 0, 0);
wait(200);
int &boom6 = create_sprite(&save_x, &save_y, 7, 167, 1);
sp_seq(&boom6, 167);
playsound(24, 22050, 0, 0, 0);
wait(200);
int &boom6 = create_sprite(&save_x, &save_y, 7, 167, 1);
sp_seq(&boom6, 167);
playsound(24, 22050, 0, 0, 0);
wait(200);
sp_active(¤t_sprite, 0);
sp_nodraw(¤t_sprite, 1);
sp_brain(¤t_sprite, 0);
spawn("your-script");
}
else
{
playsound(your_play_sound);
sp_target(¤t_sprite, 1);
}
NOTE: Your enemy's hitpoints must ALWAYS be higher than the hitpoints you actually want for it.
Hope that helps.
