ID:139320
 
Code:
mob
GM
verb
Poll()
set category = "GM"
var/obj/Z=input("What would you like to poll?")
var/obj/C=input("Possible Answer 1")
var/obj/D=input("Possible Answer 2")
var/obj/E=input("Possible Answer 3")
for(var/mob/O as mob in world)
var/obj/X=alert(O,"[Z]","Poll","[C]","[D]","[E]")
if(X=="[C]")
src.answer1+=1
if(X=="[D]")
src.answer2+=1
if(X=="[E]")
src.answer3+=1
src<<"[O.name]'s answer: [X]"
sleep(10)
src.answer1=0
src.answer2=0
src.answer3=0
src.result=0


Problem description: I'm trying to make a poll verb for my GMs. However, the poll arrives to the players in order. So it won't be shown to all the players at one time, it shows them one at a time until they answer, then it moves on to the next player. Could someone help with this?

You need to use spawn() to execute each iteration of the for() loop in a separate thread.
In response to Garthor
Could you please explain that? When I attempt to add spawn(), the code fails to recognize the X variable.
In response to Colin1011
Then you didn't get the indentation right. The spawn() block should contain everything within the for() loop (though not the loop itself).