NPC Code:
var = findPlayer(account);
"var" becomes the prefix to player "account", i.e. var.chat
Also, about passing parameters to functions.
NPC Code:
function onCreated()
{
echo(findNPC("foo").myFunction("zombies", "ninjas"));
}
NPC Code:
public function myFunction(var1, var2)
{
return("The first variable is equal to '" @ var1 @ "' and my second is equal to '" @ var2 @ "'.");
/*
In effect:
var1 = "zombies";
var2 = "ninjas";
*/
}
In the first NPC, the expected parameters are variables "var1" and "var2", so when the function is given parameters, "var1" takes the first parameter and "var2" takes the second.
The variables passed to the public function will remain local to that function in the other NPC (as in, you cannot access the parameters given to that public function in the script calling the public function)