Change font size
It is currently Thu Nov 22, 2018 5:28 am

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 1 post ]
Author Message
 Post subject: Teleport v2.02 by Pablo Pharmanaut
PostPosted: Fri May 16, 2008 3:13 am 
Site Admin
User avatar

Joined: Sat Feb 02, 2008 5:27 pm
Posts: 843
{L_CODE}:
//Teleport v2.02 by Pablo Pharmanaut
//based on code by Cubey Terra

integer totalPos = 4;                    //This integer should equal total number of positions
integer currentPos = 1;
string currentpos;

vector vPos1 = <117,152,22>;             //These are vectors for the positions to
vector vPos2 = <81,23, 103>;             //which you wish to teleport
vector vPos3 = <83, 49.00, 29>;
vector vPos4 = <67,120,22>;
//vector vPos5 = <143.3,238.8,50.2>;

string sPos1 = "Position One";           //name of positions, if desired.  This helps
string sPos2 = "Position Two";           //you to know where you are going!
string sPos3 = "Position Three";
string sPos4 = "Position Four";
//string sPos5 = "Position Five";

vector currentvPos;

setPos()
{
    if (currentPos == 1)
    {
        currentpos = sPos1;
        currentvPos = vPos1;
    }
    else if (currentPos == 2)             
    {                                     
        currentpos = sPos2;               
        currentvPos = vPos2;             
    }                                     
    else if (currentPos == 3)
    {
        currentpos = sPos3;
        currentvPos = vPos3;
    }
    else if (currentPos == 4)
    {
        currentpos = sPos4;
        currentvPos = vPos4;
    }
//  else if (currentPos == 5)
//  {
//      currentpos = sPos5;
//      currentvPos = vPos5;
//  }
   
    //add else if section here with higher currentPos integer to add TP destinations.
    //Don't forget to increase totalPos integer at top of script

    vector pos = llGetPos();
    llSetText("Teleport to "+currentpos+"\nTouch me to change destination",<1,1,1>,1.0);
    vector offset = currentvPos - pos;
    llSitTarget(offset, ZERO_ROTATION);
}

default
{
    state_entry()
    {
        llSetSitText("Teleport");            //This changes HUD display from "sit" to "Teleport"
    }
    touch_start(integer total_number)
    {
        currentPos += 1;
        if (currentPos > totalPos) currentPos = 1;
        setPos();
    }
    changed(integer change)
    {
        if ((change & CHANGED_LINK)==CHANGED_LINK)
        {
            if (llAvatarOnSitTarget() != NULL_KEY)
            {
                llUnSit(llAvatarOnSitTarget());
            }
        }
    }
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 1 post ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net