ID:142253
 
How would one go about doing that?

Example:
proc/a()
b() //This line is supposedly wrong

mob/proc/b()
world << "Yo!"


proc/a()
var/mob/M = locate() //Get a random mob. (For testing purpose only.)
if(M) //If a mob was located,
M.b() //call it's b() proc.
In response to Jemai1
So this just gets one random mob? I don't want that (your code didn't work either way).

Is there any other way to make all of the players in the game to run a proc?
In response to Skofo
Yes. See the for() loop in the DM reference.
In response to Glarfugus
Here's an example...

proc/A()
for(var/mob/M in world) //Will go through a loop of all the mobs in the world.
if(!M.key) continue //If it's an NPC, it will skip it.
M.B() //Executes the B proc for the mob.

mob/proc/B()
src << "Hi"
In response to Glarfugus
Thank you!
In response to XeroXen
You should have if(!M.client) instead of if(!M.key), because some mobs don't have players and still have keys.
Also, Skofo, be sure to read the DM Guide, because you didn't know how to do such a simple thing.
In response to Naokohiro
Naokohiro wrote:
mobs don't have players and still have keys.

But those are still player mobs.
At any case though, it was just an example. There are many ways to do things.
In response to Kaioken
Yeah, yeah...