ID:164860
 
I was wondering, how would I make a whisper verb that will only allow you to whisper to people that're right beside you? Would I just use an edited method of Say?
Michael3131 wrote:
I was wondering, how would I make a whisper verb that will only allow you to whisper to people that're right beside you? Would I just use an edited method of Say?

yeah. check for people in oview(1).
mob/verb/whisper(mob/m in oview(1))
var/msg = input("Whispering to [m]")as null|text //if this doesn't work...
var/msg = input("Whispering to [m]")as text //...try this
if(msg)
m<<"[usr] whispers: [msg]"

i don't know if "as null|text" will work so if it doesn't, try that second one.
In response to Adam753
It works perfectly. Thank you for your help! ^_^
In response to Adam753
That will work (the "as null|text").

As implied, text make sure is what is entered will be entered as a text variable (which is enabled by default). If you wanted numbers only, you would have 'as num'.. you can check out the other 'as ' command by clicking here

The | means it adds the options together (to understand more, learn about bitflag)

What 'as null' does is that it adds a cancel button, which when clicked, returns a null value (so make sure you safety check.. learn boolean shortcuts to make it efficient and quick)

- GhostAnime