ID:261360
 
Hello any way I am trying to output or << a msg to a certain type of mob in the world when a certain person enters the game.

var/mob/darkpaladin/D
D << "[usr.name] has enter login."

I trying to make D a var so it would output to that type. Any Ideas on what I can do to make this work so it << "msg" to that type in world.
You would have to use a for() loop to check all mobs in the world, and output only to a certain type, example:

mob/Login()
for(var/mob/M in world)
if(istype(M,/mob/blob))
M<<"Heya blobs [src] entered!"
else
return
..()
In response to Nadrew
Generally, thats true, but in cases where there may be a lot of mobs in the world (and/or a lot of logins), it would be best to maintain a list of everyone to output to. To use Nadrew's example, keep a global list that contains all blobs (you can add to the list when a blob is created, remove when deleted.. alternately use login/logout), and just << the text to the list.

-AbyssDragon
You could just do it like this:

for(var/mob/darkpaladin/D in world)
D << "[usr.name] has enter login."