ID:174374
 
How do u check if something is dead before continuing with the code????
<code>if (M.dead) then return</code>

If you want a better answer, ask a better question. And please don't post subject lines in all caps. And don't use multiple question marks, it's annoying. =)
In response to Crispy
1) thanks for the speedy reply
2) would I have to make a var for "dead" in (M.dead)
3) I accept all damages to your mental health and will
pay for your therapy in anyway I can until you have
fully recovered from my disturbing caps and question
marks -_-'
In response to Xallius
Xallius wrote:
1) thanks for the speedy reply

Just happened to be on at the time. =)

2) would I have to make a var for "dead" in (M.dead)

If you're saying what I think you're saying, then yes. If "M" was a mob, then you'd need to make a "dead" var belonging to mobs. And remember to set it when the mob dies.

3) I accept all damages to your mental health and will
pay for your therapy in anyway I can until you have
fully recovered from my disturbing caps and question
marks -_-'

Fair enough, I guess. =D
In response to Crispy
//heres my coding, i need to check if the M is still
//alive after the first Deathcheck

mob
player
verb
attack(mob/M as mob in oview(1))
src.locked = 1
M.locked = 1
src.power = src.strength + src.weapon_strength
src.damage_min = src.strength
src.damage_max = src.power
src.damage = rand(src.damage_min,src.damage_max)
src << "You hit the [M] for [src.damage] damage."
M.hp -= damage
Deathcheck(M)
M.damage = rand(M.damage_min,M.damage_max)
src << "You were hit by the [M] for [M.damage] damage."
src.hp -= damage
Deathcheck(src)
src.locked = 0
M.locked = 0
In response to Xallius
Well, if you'd posted that first we could have saved a lot of trouble. What you meant is to check whether a mob has been deleted, rather than "dead", right? Well, that's quite simple:

<code>if (!M) return</code>

In plain English: If M is null (i.e. does not exist any more), then quit the proc.