martedì 17 marzo 2009

Notecard Giver

Questo script lsl se inserito con una notecard all'interno di un oggetto, fa si che quando un avatar passa vicino spedisca in automatico la notecard contenuta.
Dopo aver copiato e incollato il codice, dovete cambiare il testo (New Note) con il titolo della notecard che volete inserire.

Ecco il codice:

//Notecard Giver via Sensor

list givenList;
string notecard = "New Note";
float sensorRange = 5.0;

default
{
state_entry()
{
llSensorRepeat("", NULL_KEY, AGENT, sensorRange, TWO_PI, 10);
}

sensor(integer num_detected)
{
integer x;
key detectedKey;

for (x=0; x < num_detected; x += 1)
{
detectedKey = llDetectedKey(x);
if (llListFindList(givenList, [detectedKey]) < 0)
{
givenList += llDetectedKey(x);
llGiveInventory(detectedKey, notecard);

if (llGetListLength(givenList) >= 80)
{
givenList = llDeleteSubList(givenList, 0, 59);
}
}

}
}
}

Nessun commento:

Posta un commento