Kill Object

default
{
    state_entry()
    {
        key id = llGetOwner();
        llListen(0,"",id,"kill object");
    }

    listen(integer number, string name, key id, string m)
     {
        if (m=="kill object")
        {
        llDie();
    }
}
}

 

Physics Snippett

default
{
    state_entry()
    {
        llSetStatus(STATUS_PHYSICS, TRUE);      //Apply realworld physics.
    }
}

 

Sensor Loop

default
{
    state_entry()
    {
        key id = llGetOwner();                  //Get the key for the owner of this object.
        llSensorRepeat("",id,AGENT,20,2*PI,.4); //Track the location of the owner and updates every 0.4 seconds.
    }

    sensor(integer total_number)
    {
        vector pos = llDetectedPos(0);          //Get the location of object 0, (owner).
        llSetText((string)pos, <1 ,0.5,0>, 2.0);
    }
}

 

Safety Switch

default
{
    state_entry()
    {
        llListen(0,"",NULL_KEY,"");
    }

    listen(integer channel,string name,key id,string message)
    {
        list commands=llParseString2List(message,[" "],[]);
        if (llList2String(commands,0)=="die")
        {
            llDie();
        }
    }
}