how to define M mob in world??
Please be very specific in what you want. You are asking something akin to "how do I make a clay doll in a shape of a doll?" - there's so many way that the doll can look like.

Do you want to loop through all /mob's? Or just the client's (players) /mob's?

As a side note, M is often the variable name people use for /mob but you do not necessarily have to use M.

for(var/mob/MBx in world)
MBx << "You die now []!"
MBx.TakeHP( MBx.HP )
In response to GhostAnime
i want to use it for Mobs...