AvatarInSim
De DigiWiki.
The function below determines if the avatar of the key passed to it is in the same sim (as a main agent or child agent, so it will also return TRUE for adjacent sims to a degree) 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 } } }