public LSL_String llGetOwnerKey(string id)
{
m_host.AddScriptLPS(1);
UUID key = new UUID();
if (UUID.TryParse(id, out key))
{
try
{
SceneObjectPart obj = World.GetSceneObjectPart(key);
if (obj == null)
return id; // the key is for an agent so just return the key
else
return obj.OwnerID.ToString();
}
catch (KeyNotFoundException)
{
return id; // The Object/Agent not in the region so just return the key
}
}
else
{
return UUID.Zero.ToString();
}
}