Reply to Re: A bit of scripting help needed!
If you don't have an account, just leave the password field blank.
In your attack procedure, there is no check to see what the current hp of the enemy is. You would need to add the line:
&enemy_ehp = sp_hitpoints(&mtarget, -1);
That will set the &enemy_ehp to the current hp.
The other issue is that it will probably check the current hp before the enemy is hit by the SM. You might need to add a
wait(250);
You might need to adjust the time of the wait if it doesn't line up right with the animation.
Make it longer if it still isn't working or shorter if there is a delay after the enemy dies.
Finally, if the target has 1 hp left and you hit it for 2 damage, I don't know if the hitpoints equals 0 or -1, so I would change the check to be just to be safe.
if (&enemy_ehp <= 0)
{
add_exp(&my_exp, 1);
&my_exp = 0;
&mtarget = 0;
}
Hope that helps (and works
).
&enemy_ehp = sp_hitpoints(&mtarget, -1);
That will set the &enemy_ehp to the current hp.
The other issue is that it will probably check the current hp before the enemy is hit by the SM. You might need to add a
wait(250);
You might need to adjust the time of the wait if it doesn't line up right with the animation.
Make it longer if it still isn't working or shorter if there is a delay after the enemy dies.
Finally, if the target has 1 hp left and you hit it for 2 damage, I don't know if the hitpoints equals 0 or -1, so I would change the check to be just to be safe.
if (&enemy_ehp <= 0)
{
add_exp(&my_exp, 1);
&my_exp = 0;
&mtarget = 0;
}
Hope that helps (and works






