obj/hud
Yell
layer = MOB_LAYER+21
name = "Yell"
icon = 'Tiles.dmi'
icon_state = "yell"
screen_loc = "5,13"
Click()
var/say = input("Type what you want to yell here.","Yell")as null|text
say = copytext(say,1,200)
if(usr.talked == 1)
alert("You must wait 2 seconds between sentences")
else if(!say)
return
else
for (var/mob/M in world)
if (!M.NoHear.Find(usr))
M << "<font color = red><font size= -1><b>[html_encode(filter(usr.char_name))] Yells:</b></font><b><font color = maroon><font size= -1> [html_encode(filter(say))]"
usr.talked = 1
sleep(15)
usr.talked = 0
For some wierd reason its running the sleep() proc before it's called, then saying the input.
mob/loginverbs/verb/Say(say as text)
set category = null
say = copytext(say,1,200)
if(usr.talked == 1)
alert("You must wait 2 seconds between sentences")
else if(!say)
return
else
for (var/mob/M in view(6))
if (!M.NoHear.Find(usr))
M << "<font color = Blue>[html_encode(filter(usr.char_name))] Says, <font color = aqua>[html_encode(filter(say))]"
usr.talked = 1
sleep(15)
usr.talked = 0
This is my say code, yet this one works fine.
Could it be just because its an object?
Don't use if(list.Find(whatever)) in order to see if something is in a list. Use if(whatever in list). The reason is that in the list is empty, you'll get a runtime error.
As for your problem, this is what your code is doing:
Create a loop going through all mobs in the world.
First mob found.
Tell him the message.
sleep(15)
Second mob found.
Tell him the message.
sleep(15)
Third mob found.
Tell him the message.
sleep(15)
Etc.
See where it's going wrong?