Callback NPC:OnClientMessage is called when the NPC sees the ClientMessage. This will happen every time the SendClientMessageToAll function is used and every time a SendClientMessage is sent for an NPC.
Callback NPC:OnClientMessage was added in 0.3a and will not work in earlier versions!
Callback NPC:OnClientMessage will not be called when someone says something in a regular chat. For called callback NPC:OnPlayerText.

(color, text[])
int color Message color.
string text The text of the message you want to send.

Return Values:
This callback does not handle returns.

public OnClientMessage(color, text[])
    if(strfind(text,"Bank Balance: $0") != -1) SendChat("I am poor :(");

Related Callbacks
The following callbacks might be useful as well, as they are related to this callback in one way or another.