ID:266621
 
How exactly would I go about doing this?

I've tried...

mob/proc/blah()
for(mob/M as mob in src.listed)

then single what I want out with if src.blah==M.blah... etc etc

but this doesn't open the list and give you a mob to choose from so should I do it like this...

mob/proc/blah(mob/M as mob in src.listed)


??


I"m at school soo I can't test it which is why I"m asking I'll be busy most of the day...
i would help..but i'm a newbie.. - this post is stupid

Jon Snow wrote:
How exactly would I go about doing this?

I've tried...

mob/proc/blah()
for(mob/M as mob in src.listed)

then single what I want out with if src.blah==M.blah... etc etc

but this doesn't open the list and give you a mob to choose from so should I do it like this...

mob/proc/blah(mob/M as mob in src.listed)

Well first of all, you should drop the "as mob" because it's redundant here.
I'm not sure what you mean by opening the list and giving you a mob to choose from; if you wanted to choose a mob from a list, why are you using for() to loop through every mob in the list automatically?

If you mean you want to choose from a list in which every mob meets certain criteria, that you can do:
var/list/L=list()
var/mob/M
for(M in listed)
if(blah==M.blah) L+=M
M=input("Choose a mob","Choose a mob") as null|mob in L

Lummox JR
In response to Lummox JR
thank you got what I was asking lol... In truth I hate dealing with input for some reason I've been having trouble with it...

Well I was just curious though when using for(mob/M in list it goes through all the mobs while if you use mob/proc/blah(mob/M in world i t'll give you a sorta list thingy... but ya anyways you answered my question thank you :)