LSL Script Scroll Writing Clipart Open Source

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);
            }
        }
    }
}
Code language: LSL (Linden Scripting Language) (lsl)
Print Friendly, PDF & Email