I like how it works so I wanted to know if somone could edit this for me so it works.
CODE
key agent;
integer sit;
integer line;
integer currDestNum = 0;
integer dlgChannel = 884937; //listen channel for llDialog
integer list_len;
integer groupLock;
integer listentrack;
integer timeOut = 60;
float alphaIdle = 0.05; // transparency when the transport beam is idle
float alphaBeam = 0.5; // transparency when the transport beam is energized
string notecard = "destinations"; // name of the notecard
string transport = "47117bd7-41e8-530d-439c-94bee925fbb7"; // UUID of transporter sound
string invisible = "b8d3965a-ad78-bf43-699b-bff8eca6c975"; // UUID of the nifty invisi texture
string snow = "00af7673-fe50-9c99-53c9-470a48461c0c"; // UUID of the tv snow texture
string currDestName;
string unAuthorizedMsg = "You are not authorized to use this teleporter.";
vector currDestPos;
vector startPos;
vector pos;
list destNamesList;
list destPosList;
energize()
{
llWhisper(0,"Initializing pattern buffer.");
startPos = llGetPos();
llTriggerSound(transport, 1);
llWhisper(0,"Energizing transport beam.");
llSetAlpha(alphaBeam,ALL_SIDES);
llSleep(2);
llSetColor(<1,1,1>,ALL_SIDES);
llSetAlpha(1,ALL_SIDES);
llStopAnimation("turn_180");
llWhisper(0,"Squishing "+llKey2Name(agent)+" into ball.");
llStartAnimation("ball");
llSetTexture(invisible, ALL_SIDES);
llSleep(1);
llWhisper(0,"Transporting...");
//transport
pos = llGetPos();
while (pos != currDestPos)
{
llSetPos(currDestPos);
pos = llGetPos();
}
//arrive
llWhisper(0,"Unsquishing "+llKey2Name(agent)+".");
llTriggerSound(transport, 1);
llSetColor(<0,1,1>,ALL_SIDES);
llSetTexture(snow, ALL_SIDES);
llUnSit(agent);
llWhisper(0,"Materializing "+llKey2Name(agent)+" from pattern buffer.");
llSetAlpha(alphaBeam, ALL_SIDES);
llSleep(2);
llWhisper(0,"Transport successful.");
// return
llSetAlpha(0,ALL_SIDES);
pos = llGetPos();
while (pos != startPos)
{
llSetPos(startPos);
pos = llGetPos();
}
llSetAlpha(alphaIdle, ALL_SIDES);
}
init()
{
llSetColor(<0,1,1>,ALL_SIDES);
llSetAlpha(alphaIdle, ALL_SIDES);
dlgChannel = (integer)(llFrand(10000)+1000);
llListen(dlgChannel,"","","");
llGetNotecardLine( notecard, line );
list_len = llGetListLength(destNamesList);
//adminMenu();
}
listenStatus(integer onOff)
{
llSetTimerEvent(timeOut);
if (listentrack)
{
llListenRemove(listentrack);
listentrack = 0;
}
if (onOff == TRUE) listentrack = llListen(dlgChannel, "", "", "");
}
menu()
{
listenStatus(TRUE); // start the menu listen
string dText = "TELEPORTER CONTROL\nCurrent destination:\n\t"+(string)(currDestNum+1)+". "+currDestName+"\n\t"+llGetRegionName()+"("+(string)((integer)currDestPos.x)+", " + (string)((integer)currDestPos.y) + ", " + (string)((integer)currDestPos.z) + ")";
llDialog(agent,dText,["Previous","Next","ENERGIZE!","Say List"],dlgChannel);
}
adminMenu()
{
listenStatus(TRUE); // start the menu listen
string dText = "TELEPORTER OWNER SETUP\n\nThis teleporter has two modes:\n* PUBLIC - Anyone can use it.\n* GROUP - Only group members can use it (Be sure to set the teleporter beam's group).";
llDialog(llGetOwner(),dText,["PUBLIC", "GROUP", "Reload List"],dlgChannel);
}
setDest()
{
list_len = llGetListLength(destNamesList);
currDestName = llList2String(destNamesList, currDestNum);
currDestPos = (vector)llList2String(destPosList, currDestNum);
}
default
{
state_entry()
{
llSitTarget(<0,0,-0.4>,ZERO_ROTATION);
llSetSitText("Teleport");
llSetTextureAnim (ANIM_ON | LOOP, ALL_SIDES, 4, 4, 0, 0, 15.0);
init();
}
on_rez(integer num)
{
llResetScript();
}
touch_start(integer num)
{
integer i;
key clicker = llDetectedKey(i);
if (clicker == llGetOwner()) // Only the owner can set the admin options
{
adminMenu();
}
}
listen(integer channel, string name, key id, string message)
{
message = llToLower(message);
if (message == "next")
{
if (currDestNum < (list_len - 1)) currDestNum += 1;
else currDestNum = 0;
setDest();
menu();
}
else if (message == "previous")
{
if (currDestNum > 0) currDestNum -= 1;
else currDestNum = (list_len - 1);
setDest();
menu();
}
else if (message == "energize!")
{
energize();
}
else if (message == "public")
{
groupLock = FALSE;
llDialog(llGetOwner(),"TELEPORTER OWNER SETUP:\n\n\tTeleporter is now set to PUBLIC mode. Anyone can use it.",[],dlgChannel);
}
else if (message == "group")
{
groupLock = TRUE;
llDialog(llGetOwner(),"TELEPORTER OWNER SETUP:\n\n\tTeleporter is now set to GROUP mode. Only members of the same group can use it.",[],dlgChannel);
}
else if (message == "reload list")
{
llResetScript();
}
if (message == "say list" )
{
llWhisper( 0, "Transporter destinations:" );
integer len = llGetListLength(destNamesList);
integer i;
for( i = 0; i < len; i++ )
{
llWhisper( 0, llList2String(destNamesList, i) + ": "+ llList2String(destPosList, i) );
}
llWhisper( 0, "Total destinations = " + (string)len );
menu();
}
}
changed(integer change)
{
if (change & CHANGED_LINK)
{
integer authorized = TRUE;
agent = llAvatarOnSitTarget();
if ((agent != NULL_KEY) && (!sit))
{
if (groupLock) // if locked to group use only by owner
{
if (!llSameGroup(agent)) authorized = FALSE;
}
if (authorized)
{
llRequestPermissions(agent, PERMISSION_TRIGGER_ANIMATION);
llStopAnimation("sit");
llStartAnimation("turn_180");
sit = TRUE;
setDest();
menu();
}
else
{
llWhisper(0,unAuthorizedMsg);
llUnSit(agent);
listenStatus(FALSE); // stop the menu listen
}
authorized = TRUE; // reset authorization
}
else if (agent == NULL_KEY && sit)
{
llStopAnimation("turn_180");
llStopAnimation("ball");
llReleaseControls();
sit = FALSE;
listenStatus(FALSE);// stop the menu listen
}
}
}
//CHECK PERMISSIONS
run_time_permissions(integer perm)
{
if (perm & (PERMISSION_TRIGGER_ANIMATION))
{
//llStopAnimation("sit");
//llStartAnimation("turn_180");
}
}
dataserver( key query_id, string data )
{
if (data != EOF)
{
if (line%2 == 0)
{
destNamesList += data;
}
else if (line%2 != 0)
{
destPosList += data;
}
line++;
llGetNotecardLine( notecard, line );
}
else
{
llWhisper(0, "Destination data loaded. Transporter is ready.");
}
}
timer()
{
if (!sit)
{
listenStatus(FALSE); // stop the listen
llSetTimerEvent(0.0); // stop the timer
}
}
}
This how the card called destinations look like for teleport locations:
CODE
6th Floor
<128.000, 128.000, 128.000>
5th Floor
<128.000, 128.000, 128.000>
4th Floor
<128.000, 128.000, 128.000>
3rd Floor
<128.000, 128.000, 128.000>
2nd Floor
<128.000, 128.000, 128.000>
1st Floor
<128.000, 128.000, 128.000>
Outside
<59.087, 109.892, 38.663>
Basement
<18.193, 92.397, 28.763>