Ok, First you need a little background...
1. The GetPCChatMessage function call, gets the last message spoken outloud in the game.
Initially, this doesnt sound useful, but, when used in the Module 'OnPlayerChat' event, it then allows you to fire functions, scripts and events on each chat message sent by players.
What you should do is the following
//This is your onChatScript for your module
void main()
{
object oChatter = GetPCChatter(); // Cant remember if this is the right function name...
object oArea = GetArea(oChatter);
string sScript = GetLocalString(oArea,"CHAT_SCRIPT");
if(sScript != "")
{
ExecuteScript(sScript);
}
}
This is the start of a simple framework allowing you to have different scripts run, for different areas.
You would then make another script, specific for your personal quarters/secure area.
You would then use the GetPCChatMessage and other GetPCChat functions, inside that function/script, to make the npcs react and follow direction as appropriate.
The tricky bit is actually knowing which npc to give the orders to, but I would solve that by storing the NPC Guards on the Player themselves, as Local Objects.
That way, you dont need to loop through all creatures,or objects to find the guards, just get the guards from the player via GetLocalObject()