Forgot? Join

Scripting

LSL Guide

Every script function this grid actually runs, read straight from the region software rather than copied from a wiki — including the wolf* functions that exist only here.

Functions · Constants

llSensor

LSL
void llSensor(string name, string id, integer type, float range, float arc)

Performs a single scan for Name and ID with Type (AGENT, ACTIVE, PASSIVE, and/or SCRIPTED) within Range meters and Arc radians of forward vector.\ Specifying a blank Name, 0 Type, or NULL_KEY ID will prevent filtering results based on that parameter. A range of 0.0 does not perform a scan.\ Results are returned in the sensor and no_sensor events.

Parameters

TypeName What it does
string name Only this name, or "".
string id Only this key, or NULL_KEY.
integer type AGENT, ACTIVE, PASSIVE or SCRIPTED, combinable with |.
float range Metres, up to 96.
float arc Radians either side of the prim's forward axis; PI is all round.

Example

default
{
    touch_start(integer n)
    {
        llSensor("", NULL_KEY, AGENT, 20.0, PI);
    }
    sensor(integer found)
    {
        integer i;
        for (i = 0; i < found; ++i)
            llSay(0, llDetectedName(i) + " is " + (string)llRound(llVecDist(llGetPos(), llDetectedPos(i))) + " m away");
    }
    no_sensor()
    {
        llSay(0, "Nobody within 20 m.");
    }
}
Energy 10

The Linden Scripting Library — what every SL-compatible grid provides.

More in LSL