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