LSL Wiki Mirror : LibraryAvatarInSim

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings ::
The function below determines if the avatar of the key passed to it is in the same sim as the script calling it.

float InSim(key id)
{
     return (llGetObjectMass(id));
}

Example Function Usage:
float InSim(key id)
{
     return (llGetObjectMass(id));
}

default
{
     touch_start(integer t)
     {
          if (InSim(llDetectedKey(0)))
          {
               // AV In Same Sim
          }
          else
          {
               // AV Not In Same Sim
          }
     }
}

Example Non-Function Usage:
default
{
     touch_start(integer t)
     {
          if (llGetObjectMass(llDetectedKey(0)))
          {
               // AV In Same Sim
          }
          else
          {
               // AV Not In Same Sim
          }
     }
}
There is no comment on this page. [Display comments/form]