Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

How to edit the llSitTarget Teleport script to have multiple destinations

Gattz Gilman
Banned from RealLife :/
Join date: 29 Feb 2004
Posts: 316
07-19-2004 14:46
_____________________
Goshua Lament
Registered User
Join date: 25 Dec 2003
Posts: 703
07-20-2004 09:07
Glad to hear that you found it. Could you post your findings for us to learn from?
_____________________
Flickr Second Life Photo Gallery

I no longer regularly login to SecondLife, but please contact me if an issue arises that needs my attention.
Gattz Gilman
Banned from RealLife :/
Join date: 29 Feb 2004
Posts: 316
07-20-2004 14:13
Sure, he is the completed multiple destination script:

CODE

integer counter=0;
vector dest;
default
{
state_entry()
{
llSetSitText("Teleport");
llSetText(fltText, <1,1,1>, 1);
}

touch_start(integer num_detected)
{
if(counter == 0)
{
llSay(0,"Teleport to 'TelePod'");
dest = <57,226,7>;
llSitTarget(dest-llGetPos(), <0,0,0,1>);
};
if(counter == 1)
{
llSay(0,"Teleport to 'Hangar'");
dest = <66.923,212.836,301.024>;
llSitTarget(dest-llGetPos(), <0,0,0,1>);
};
if(counter == 2)
{
llSay(0,"Teleport to 'Entrance'");
dest = <56.369,230.361,310.991>;
llSitTarget(dest-llGetPos(), <0,0,0,1>);
counter = counter - 3;
};
counter++;

}

changed(integer change)
{
key currentAVkey = llAvatarOnSitTarget();
if (currentAVkey != NULL_KEY && lastAVkey == NULL_KEY)
{
lastAVkey = currentAVkey;
if (!(llGetPermissions() & PERMISSION_TRIGGER_ANIMATION))
llRequestPermissions(currentAVkey,PERMISSION_TRIGGER_ANIMATION);
llUnSit(currentAVkey);
llStopAnimation("sit");
llResetScript();
}
}
}
Hank Ramos
Lifetime Scripter
Join date: 15 Nov 2003
Posts: 2,328
07-20-2004 14:15
CODE

integer counter=0;
vector dest;
default
{
state_entry()
{
llSetSitText("Teleport");
llSetText(fltText, <1,1,1>, 1);
}

touch_start(integer num_detected)
{
if(counter == 0)
{
llSay(0,"Teleport to 'TelePod'");
dest = <57,226,7>;
llSitTarget(dest-llGetPos(), <0,0,0,1> );
};
if(counter == 1)
{
llSay(0,"Teleport to 'Hangar'");
dest = <66.923,212.836,301.024>;
llSitTarget(dest-llGetPos(), <0,0,0,1> );
};
if(counter == 2)
{
llSay(0,"Teleport to 'Entrance'");
dest = <56.369,230.361,310.991>;
llSitTarget(dest-llGetPos(), <0,0,0,1> );
counter = counter - 3;
};
counter++;

}

changed(integer change)
{
key currentAVkey = llAvatarOnSitTarget();
if (currentAVkey != NULL_KEY && lastAVkey == NULL_KEY)
{
lastAVkey = currentAVkey;
if (!(llGetPermissions() & PERMISSION_TRIGGER_ANIMATION))
llRequestPermissions(currentAVkey, PERMISSION_TRIGGER_ANIMATION);
llUnSit(currentAVkey);
llStopAnimation("sit");
llResetScript();
}
}
}
_____________________
Gattz Gilman
Banned from RealLife :/
Join date: 29 Feb 2004
Posts: 316
07-20-2004 14:53
Thanx Hank, wasnt sure at the time how to put the code like that :), but i think i know now.