mob
proc
Death(mob/M)
if(src.health <= 0&&src.NPC==0)
world << "<font color=red>[M] killed [src].</font color>"
src.Deaths += 1
M.kills += 1
M.doing=0
src.loc = locate(1,1,1)
sleep(50)
src<<"You'll be brought back in 5 seconds..."
src.health = src.maxhealth
return
Problem description:when i try to kill someone it works but it announces that NPC has kill NPC! WHY IS IT DOING THAT IF ITS M AND src
I even tried to reinstall byond
No need to shout. >_> M is a variable (proc argument/parameter) that is passed from outside, so you're probably supplying the wrong one; we need to use the code where you're actually calling the Death() proc.
Also, there are little problems in your code. Don't use if(var==1) to check if it's true, if(var) already checks that, the former just runs the == operator then tests if it returned true as normal, but you don't need to check for a specific value, so just use if(Var) to check if Var is true.
Lastly, use the ++ and -- operators to increase or decrease a variable by 1. No major difference here, but they're just a bit faster than using += (and they also have an additional function, though of no use in this particular case).
Oh, and HTML tags are closed by just the base tag with / at the beginning, but with no attributes. What I mean is, no matter how many attributes your <font> tag has (color, face, size...), you close it with no attributes - just </font> only.
Well, that's not going to solve any Code Problems.