Basic Rocket Script

Expired

default
{
    state_entry()
    {
        llSetStatus(STATUS_PHYSICS, TRUE);
        llSetForce(<0,0,40>, TRUE);
    }
}

Library Air Sea Altimeter

Expired

default
{
    state_entry()
    {
        llSetTimerEvent(.01); // How often your timer() event updates
    }

    timer()
    {
        vector pos = llGetPos(); // Gets your current position
        vector size = llGetAgentSize(llGetOwner()); // Get the dimensions of your agent
        size.z = size.z / 2.0; // Halve the height element of your agent, get altitude from feet
        float aboveground = ((float)pos.z - llGround(<0.0,0.0,0.0>) - size.z); // Distance above ground 
        if (aboveground <0.0) // If it thinks your feet are below ground 
        {
            aboveground = llSqrt(aboveground * aboveground); // - flip it
        }
        if (aboveground < 0.09) // Check the margin of error for zeroing - you can redefine this
        {
            aboveground = 0.0; // Zero it out
        }
        vector Speed = llGetVel(); // LSL function that should be fixed in next release.
        float RealSpeed = llVecMag(Speed); // Convert it to velocity you can use.
        float abovewater = llWater(<0.0,0.0,0.0>) - pos.z; // difference between yourwater height
        if (pos.z >= llWater(<0.0,0.0,0.0>)) // If at or above water
        {
            abovewater = llSqrt(abovewater * abovewater);             
        }        
        if (pos.z )) // If underwater
        {
            abovewater = abovewater - (abovewater * 2.0); // Push the number into the negative range      
        }
        llSetText("Sea Lvl ALT: " + (string)abovewater + "\n" + "Grnd Lvl ALT: " + (string)(aboveground) + "\nSpeed: " + (string)RealSpeed, <1 .0,0.0,0.0>, 1.0); // Emit string          
    }
}

 

Bouncing Stone Ride

Expired

default {
    state_entry() {
        llSay(0, "Bouncing Stone online...");
        llSetSitText("Ride");
        llSitTarget(<0.1,0.1,0.1>, ZERO_ROTATION);
        llSetStatus(STATUS_PHYSICS, FALSE);
        //llSetTimerEvent(6.0);
    }
 
    changed(integer change) {
        if (change & CHANGED_LINK) {
            key agent = llAvatarOnSitTarget();
            if (agent) {
                if (agent != llGetOwner()) {
                } else {
                    llSay(0, "Launch! Yeehaw!");
                    llSetStatus(STATUS_PHYSICS, TRUE);
                    llSetTimerEvent(6.0);
                }
            } else {
                llSetTimerEvent(0.0);
                llSetStatus(STATUS_PHYSICS, FALSE);
                llSay(0, "Stopped.");
            }
        }
    }
 
land_collision(vector pos) {
    llApplyImpulse(<0,0,700>, FALSE);
    llSetTimerEvent(6.0);
}
 
    timer() {
        llApplyImpulse(<0,0,700>, FALSE);
        llApplyRotationalImpulse(, FALSE);
    }
}

 

Speedometer

Expired

// Speedometer Working By Jimmy Roo
//Here is a Speedometer I made this morning, because I got bored. It will Give your speed in KPH, rounded to the nearest KPH. It works by subtracting the x, y, z values of the current pos, and the pos from 0.5 seconds ago. it then works out the horizontal distance traveled,
 
//square root of (square root of( (x1*x2) + (y1*y2) ) * square root of ( z1 * z2 )))
 
vector current;
vector new;
float xvalue;
float yvalue;
float zvalue;
 
default
{
    state_entry()
    {
        vector current = llGetPos();
        llSetTimerEvent(0.5);
    }
 
    timer()
    {
        new = llGetPos();
        if ( new. x  current .x)
        {
         xvalue =  new .x - current .x ;
        }
          if ( new .x == current .x)
        {
         xvalue =  new .x - current .x ;
        }
 
                if ( new.y  current .y)
        {
         yvalue =  new .y - current .y ;
        }
         if ( new .y == current .y)
        {
         yvalue =  new .y - current .y ;
        }
 
                        if ( new.z  current .z)
        {
         zvalue =  new .z - current .z ;
        }
         if ( new .z == current .z)
        {
         zvalue =  new .z - current .z ;
        }
 
        float beforevalue = llSqrt((yvalue * yvalue) + (xvalue * xvalue));
        float aftervalue =  llSqrt((beforevalue * beforevalue) + (zvalue * zvalue));
 
        llSetText((string)llRound((7.2 * aftervalue)) + " kph", <1 ,0,0>, 1);
        current = new;
    }
 
}