CODE
//////////////////////////////////////////////////////////
//
// nnKey2FirstName
// By Nepenthes Ixchel
//
// arguments:
// (key) id: the id of the aganet to return the firstname of.
//
// Return value:
// (string) The agents first name (all text before the first space, or entire name if there is no space.)
//
// License:
// This code is free to use for any purpose provided a comment of some sort is included in
// the code attributing it to Nepenthes Ixchel. (even if the script is distributed no-mod)
string nnKey2FirstName(key id)
{
return (llGetSubString(llKey2Name(id),0,-1+llSubStringIndex(llKey2Name(id)," ")));
}
////////////////////////////
//
// simple testbed code
default
{
touch_start(integer total_number)
{
llSay(0, "Hello "+nnKey2FirstName(llDetectedKey(0)));
}
}