ID:143221
 
Code:
mob
proc
Deathcheck(mob/M in world)
if(src.HP<=0)
world<<"[src] Has been killed by [M]!"
M.exp+= 50
src.death+=1
M.kills+=1
src.loc=locate(8,10,1)
src.HP=src.MHP
usr.Level_Up()


Problem description:
the problem is with everything with M in it, it cant find the mob so when a person dies it says "blah has been killed by ! and the pretty much all this
                M.exp+= 50
src.death+=1
M.kills+=1
src.loc=locate(8,10,1)
src.HP=src.MHP
usr.Level_Up()

wont work and as you can see im not that experienced of a coder.
Scarymonkeys623 wrote:
Code:
> mob
> proc
> Deathcheck(mob/M in world)
> if(src.HP<=0)
> world<<"[src] Has been killed by [M]!"
> M.exp+= 50
> src.death+=1
> M.kills+=1
> src.loc=locate(8,10,1)
> src.HP=src.MHP
> usr.Level_Up()
>

Problem description:
the problem is with everything with M in it, it cant find the mob so when a person dies it says "blah has been killed by ! and the pretty much all this
>               M.exp+= 50
> src.death+=1
> M.kills+=1
> src.loc=locate(8,10,1)
> src.HP=src.MHP
> usr.Level_Up()
>

wont work and as you can see im not that experienced of a coder.

The main problem is probably that you're not passing M correctly to this proc. Once you do that, it should work fine.

You also should change usr.Level_Up() to M.Level_Up(). usr doesn't belong in a proc, but M is what you want.

Lummox JR
In response to Lummox JR
Problem is you're making the proc's arguments wrong. You don't need "in world", all you need is "mob/M" and calling the proc the proper way, "Deathcheck(target_here)".
In response to Kaiochao2536
The "in world" isn't going to cause any problems. It's pointless for procs, but it won't hurt anything.
In response to Kaiochao2536
Kaiochao2536 wrote:
Problem is you're making the proc's arguments wrong. You don't need "in world", all you need is "mob/M" and calling the proc the proper way, "Deathcheck(target_here)".

Of course it's actually the killer that's supposed to be the argument, not the target.

Lummox JR