The LSL function llName2Key was one of the LSL functions that never was implemented on OpenSim. It returns a key the Agent ID for the named agent in the region. If there is no agent with the specified name currently signed onto the region, this function returns the value NULL_KEY.
Names are always provided in the form "First[ Last]" or "first[.last]" (first name with an optional last name.) If the last name is omitted a last name of "Resident" is assumed.
OpenSim grids usually don’t implement the Resident last name but requires proper First and Last names, so returning Resident should be an edge case.
OpenSim also has more complex Agent ID as hypergrid visitors to a grid will have the hypergrid addess appended to the name in addition to have a dot between First and Last. Therefore names of the form First.Last @grid.xmir.org:8002 or First.Last.@grid.xmir.org:8002 will work. Viewers like Firestorm will also add an additional @in front of the First name and variations thereof should also work in most cases.