Skip to content

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);
            }
        }
    }
}
 

Related Posts

Readers who viewed this page, also viewed:

Comments

There are no comments on this entry.

Trackbacks

There are no trackbacks on this entry.

blog comments powered by Disqus

Status Updates

My images

Second Anniversary of Locus AmoenusLocus Amoenus Anniversary CeremonyPolitics doesn't need to be taken so serious...Preview of current work at the Lisbon 1755 projectKaseido Quandry at the Representative MeetingWind-blown on the Sun Castle
Gwyneth Llewelyn is offline in Second Life.
Digg! Listed on BlogShares Site Meter EgoSurf for Gwyneth Llewelyn