default
{
state_entry()
{
llSetTimerEvent(1); //Repeats the sensor every 1 second.
}
timer()
{
llSensor("WBS1",NULL_KEY,ACTIVE,95,PI);
}
sensor(integer num_detected)
{
//Do Stuff here.
// we use a FOR loop here because two people can click the object at the same time.
integer i;
for (i = 0; i <>
{
// llGetAgentInfo returns a bitfield. Use & instead of == for comparisons.
//if (llGetAgentInfo(llDetectedKey(i)) & AGENT_FLYING)
// {
llSay(0, llDetectedName(i) + ", you're in my range.");
// }
// else
// {
// llSay(0, llDetectedName(i) + ", you're not flying.");
// }
}
}
}
Wireless Base Station 1:
default
{
state_entry()
{
llSetTimerEvent(1); //Repeats the sensor every 1 second.
//integer handle = llListen( 10, "WBS2", NULL_KEY, "" );
}
timer()
{
llSensor("WBS2",NULL_KEY,ACTIVE,95,PI);
}
sensor(integer num_detected)
{
//Do Stuff here.
// we use a FOR loop here because two people can click the object at the same time.
integer i;
for (i = 0; i <>
{
// llGetAgentInfo returns a bitfield. Use & instead of == for comparisons.
//if (llGetAgentInfo(llDetectedKey(i)) & AGENT_FLYING)
//{
llSay(0, llDetectedName(i) + ", you're in my range.");
//}
//else
//{
// llSay(0, llDetectedName(i) + ", you're not flying.");
//}
}
}
}
Heavy Snow Fall:
default
{
state_entry()
{
llSay(0, "Hello, Avatar!");
}
touch_start(integer total_number)
{
llSay(0, "Touched.");
llParticleSystem([PSYS_PART_FLAGS, PSYS_PART_FOLLOW_SRC_MASK | PSYS_PART_EMISSIVE_MASK,
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE | PSYS_SRC_BURST_RADIUS,
PSYS_PART_START_COLOR, <1,1,1>,PSYS_SRC_ANGLE_BEGIN,1.57]);
}
}
Light but fast snowfall:
default
{
state_entry()
{
llSay(0, "Hello, Avatar!");
}
touch_start(integer total_number)
{
llSay(0, "Touched.");
llParticleSystem([PSYS_PART_FLAGS, PSYS_PART_FOLLOW_SRC_MASK | PSYS_PART_EMISSIVE_MASK,
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE | PSYS_SRC_BURST_RADIUS,
PSYS_PART_START_COLOR, <1,1,1>,PSYS_SRC_ANGLE_BEGIN,1.57,PSYS_SRC_BURST_RADIUS,110.0,PSYS_PART_START_SCALE,<0.1,0.1,0.1>,PSYS_PART_END_SCALE,<0.1,0.1,0.1>,PSYS_SRC_BURST_PART_COUNT,100]);
}
}
Light Snow Fall:
default
{
state_entry()
{
llSay(0, "Hello, Avatar!");
}
touch_start(integer total_number)
{
llSay(0, "Touched.");
llParticleSystem([PSYS_PART_FLAGS, PSYS_PART_FOLLOW_SRC_MASK | PSYS_PART_EMISSIVE_MASK,
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE | PSYS_SRC_BURST_RADIUS,
PSYS_PART_START_COLOR, <1,1,1>,PSYS_SRC_ANGLE_BEGIN,1.57,PSYS_SRC_BURST_RADIUS,110.0,PSYS_PART_START_SCALE,<0.1,0.1,0.1>,PSYS_PART_END_SCALE,<0.1,0.1,0.1>,PSYS_SRC_BURST_PART_COUNT,100]);
}
}
Listen on a Channel & Respond:
default { state_entry() { // listen on channel zero for any chat spoken by the object owner. llListen(0,"",llGetOwner(),""); } listen(integer channel, string name, key id, string message) { // check if the message corresponds to a predefined string. // llToLower converts the message to lowercase. // This way, "HELLO", "Hello" or "HeLLo" will all work the same way. if (llToLower(message) == "hello") { // if the message from the owner is "hello", respond with "Hello.". llSay(0,"Hello."); } } }