• Winking Gwyn
  • Categories

  • Feeling generous today? Any money received will support the continued web hosting of this blog. Donate towards my web hosting bill!
  • Creative Commons License
  • Gwyneth Llewelyn is offline in Second Life.
  • Pages

  • Meta

  • Blog Rank: 46,803
02 Mar

Simple Intra-Simulator Teleporting Tool

Also an exercise for my LSL scripting classes, this one is a simple llSetPos teleporting script. The final location is written as <X,Y,Z> on the object’s description.

vector destination;
key avatar;

default
{
    state_entry()
    {
        destination = (vector)llGetObjectDesc();  
        if (destination == ZERO_VECTOR)
            destination = llGetPos();
        llWhisper(0, "Configured; destination is " + (string)destination);
        llSitTarget(destination, ZERO_ROTATION);
    }
   
    on_rez(integer start_param)
    {  
        llResetScript();
    }

    changed(integer change)
    { // something changed
        if (change & CHANGED_LINK)
        { // and it was a link change
            llSleep(0.5); // llUnSit works better with this delay
            avatar = llAvatarOnSitTarget();
            if (avatar != NULL_KEY)
            {
                // llInstantMessage(avatar, "Going to " + (string)destination);
                llUnSit(avatar);
            }
        }
    }
}
 

Leave a Reply

Login Method

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© 2008 Gwyn’s Home | Entries (RSS) and Comments (RSS)

Powered by Wordpress, design by Web4 Sudoku, based on Pinkline by GPS Gazette