Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

2 levels slow elevator

Dragos Zaoh
Registered User
Join date: 11 Dec 2006
Posts: 58
06-28-2007 12:21
CODE
vector pos;
string gName = "New Note";
integer gLine = 0;
integer zlobby;
integer zfloor2;
integer j;
string lobby;
key gQueryID;


default
{
state_entry()
{
gQueryID = llGetNotecardLine(gName, gLine);

llListen(0, "", NULL_KEY, "");
}
dataserver(key query_id, string data)
{ if (query_id == gQueryID)
{ if (data != EOF)
{
if (gLine==1) { zlobby = (integer)data;}
if (gLine==3) { zfloor2 = (integer)data;}


++gLine;
gQueryID = llGetNotecardLine(gName, gLine);
}

}}
listen(integer ch, string name, key id, string message)
{
pos = llGetPos();
llSay(2, "close");
llWhisper(0, "Going To " + message);
llSleep(1.5);
if (message == "The Lobby")
{ llSay(0,(string)zlobby);
pos = llGetPos();
j = (integer)pos.z;

if (j < zlobby) {
for (j = (integer)pos.z; j < (zlobby + 1); j++)
{ llSetPos(<pos.x,pos.y,j>);}
llSleep(1.5);
llSay(2, "open");

}
if (j > zlobby) {
for (j = (integer)pos.z; j > (zlobby - 1); j--)
{ llSetPos(<pos.x,pos.y,j>);}
llSleep(1.5);
llSay(2, "open");
llWhisper(0, "Welcome to " + message);}
}
else if (message == "Floor 1")
{ llSay(0,(string)zfloor2);
pos = llGetPos();
j = (integer)pos.z;
if (j < zfloor2) {
for (j = (integer)pos.z; j < (zfloor2 + 1); j++){
llSetPos(<pos.x,pos.y,j>);}
llSleep(1.5);
llSay(2, "open");

}
if (j > zfloor2) {
for (j = (integer)pos.z; j > (zfloor2 - 1); j--){
llSetPos(<pos.x,pos.y,j>);}
llSleep(1.5);
llSay(2, "open");
llWhisper(0, "Welcome to " + message);}


}


}
}






The Notecard should look like this :
Lobby
0
Level2
0
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Discussion Thread
06-29-2007 00:21
/54/18/194140/1.html
_____________________
i've got nothing. ;)