ID:266452
 
How would I go about making it so only people with a certain var like hearing = "true" would hear a say
Try this.

mob/var/hearing="true"

mob/verb/Say(T as text)
for(var/mob/M in world)
if(M.hearing=="true")
usr<<"[src.name]: [html_encode(T)]"
In response to Super16
Ahh crap it works except it gave me about 200 msgs that were the thing that the person typed!
In response to Thief Jack
Try using break
ugh where lol sorry i kinda suck at coding :\
In response to Thief Jack
Wait theif when I posted I used usr<< here is the code I meant:P

mob/var/hearing="true"

mob/verb/Say(T as text)
for(var/mob/M as mob in world)
if(M.hearing=="true")
M<<"[src.name]: [T]"

It works :P
In response to Super16
see this is how i want it to work
------------------------------------
mob
verb/Say(T as text)
for(var/mob/M in world)
if(M.Hearing == "True")
usr << "[src.name]: [html_encode(T)]"
else
oview() << "[src.name]: [html_encode(T)]"
usr << "[src.name]: [html_encode(T)]"
but the problem is, is that it spams me with the same message like 40 times
In response to Thief Jack
let me guess what this one does-
you type in a message, and for every mob in the world, you see that message, regardless of whether they had healing or not.
You should probably have something like this:
Say(T as text)
for(var/mob/M)
if(M.hearing == "True")
M << "[usr]: [T]"

Every mob that has hearing will see the message. I think...
(Note: >> equals one tab)