The Dink Network

Reply to Re: A bit of scripting help needed!

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
April 16th 2007, 09:35 AM
duck.gif
wesley
Peasant He/Him United States
 
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 ).