If I understand you correctly, you can do something like...
NPC Code:
function onCreated()
{
putnpc2(x,y,"join(\"classname\");
this.master = player.account;
");
}
Then in a class npc...
NPC Code:
//#CLIENTSIDE
function onPlayerChats()
{
if ( player.chat == "/test" ) {
if ( this.master == player.account ) {
chat = "Hello, Master!";
} else {
chat = "You are not my master!";
}
}
}
It all depends on how you want to do it.