Yes, ATHK got it right. input() has an optional first argument which is the player that gets the input box - by default, it's usr, so you need to specify it in cases like this.
Also, I don't think checking if the client is valid is very important in this case, as input() should just terminate with no input box generated and return null, which isn't exactly fatal. :)
Yes, ATHK got it right. input() has an optional first argument which is the player that gets the input box - by default, it's usr, so you need to specify it in cases like this.
Also, I don't think checking if the client is valid is very important in this case, as input() should just terminate with no input box generated and return null, which isn't exactly fatal. :)
If you try to send input() or alert() to a clientless mob, you'll get a "bad client" error. However, this is easily avoided if you loop through all clients in the world, not all mobs in the world.
Of course, one additional consideration is that input() will wait for a response, so you'll need to spawn() out each call to it.