LlSensor

De DigiWiki.

This sensor scans a 45 degree cone about the x-axis. (PI/2 or PI_BY_TWO scans a hemisphere. PI is a spherical scan.)

llSensor( "Gigs Taggart", NULL_KEY, AGENT, 96.0, PI/4 );

This sensor detects all prims and agents with a given name within 15m of the sensor. (AGENT, PASSIVE and ACTIVE behave inclusively. SCRIPTED is not inclusive and will exclude non-scripted targets (like avatars) from the detected set.)

llSensor( "", NULL_KEY, ( AGENT | PASSIVE | ACTIVE ), 15.0, PI );

Basic example script that when touched executes a sensor scan of agents. When the sensor event is processed it spits out messages to the owner of each detected agents' name.

default
{
    touch_start(integer total_number)
    {
        llSensor("", NULL_KEY, AGENT, 30.0, PI);
    }
 
    sensor( integer detected )
    {
        while(detected--)
        {
            llOwnerSay(llDetectedName(detected));
        }
    }
}
Outils personnels
  • Cette page a été consultée 834 fois.
donate
Google Ads