Button script, make two buttons per floor, one attached to the elevator itself, the other as a call button on the outside of the elevator on the floor it represents:
First Floor:
CODE
default
{
touch_start(integer total_number)
{
llSay(3,"one"); //Triggers the elevator
llSay(0, "Welcome to the First Floor"); //the welcome message.
}
}
Second Floor:
CODE
default
{
touch_start(integer total_number)
{
llSay(3,"two"); //Triggers the elevator
llSay(0, "Welcome to the Second Floor"); //the welcome message.
}
}
Third Floor:
CODE
default
{
touch_start(integer total_number)
{
llSay(3,"three"); //Triggers the elevator
llSay(0, "Welcome to the Third Floor"); //the welcome message.
}
}
Then there is the elevator scrpt:
CODE
//Elevator Script
vector start_pos;
default
{
state_entry()
{
llSetStatus (STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);
start_pos=llGetPos();
llSetStatus(STATUS_PHYSICS,TRUE);
llMoveToTarget(start_pos,1.5);
key id ="";
llListen(3,"",id,"");//choose a different channel for your elevator to listen to other than 0, which would be "audiable" I chose 3 here
}
listen(integer a, string n, key id, string m)
{
vector move_pos;
if (m=="two")//This is for the second floor level
{
move_pos=start_pos+<0,0,1>;//exparament to set the hight just right, usually around 6 meters per floor, but of course that can very, plus you want to get it just right.
llMoveToTarget(move_pos,0.2);//this is set so that the elevator does not colide with the floor (and cause it to wiggle, giggle and jerk)
}
if (m=="three")//this is the third floor
{
move_pos=start_pos+<0,0,2>;//This would normally be set around 12 meters. The settings could also be set for sideways elevators, like on the Enterprise ;P go to exact locations!
llMoveToTarget(move_pos,0.2);
}
if (m=="one")
{
llMoveToTarget(start_pos,0.2);//we go home here to where the elevator was created or the script was started.
}
}
}
I sure hope people like that... I have a sample elevator you can come by and copy at Sistiana 132, 114 (pardon my dust) I really will get back to that Bradbury building, I promise!!!
Love Ingie
edit- edited to make it a little more readable, and fixed one line that would have broken it on a copy paste. ne