For each button:
default
{
touch_start(integer total_number)
{
llMessageLinked(LINK_ROOT, 0, "first", NULL_KEY);
}
}
(of course for the second floor button, I said "second" instead of "first", etc.)
For the elevator floor (root prim):
vector first = <86.387, 182.078, 29.301>;
vector second = <86.387, 182.078, 36.957>;
vector third = <86.387, 182.078, 47.777>;
vector fourth = <86.387, 182.078, 57.638>;
vector pos;
default
{
link_message(integer sender_num, integer num, string str, key id)
{
pos = llGetPos();
if(str=="first"

{
pos.z = first.z;
llSetPos(pos);
}
if(str=="second"

{
pos.z = second.z;
llSetPos(pos);
}
if(str=="third"

{
pos.z = third.z;
llSetPos(pos);
}
if(str=="fourth"

{
pos.z = fourth.z;
llSetPos(pos);
}
}
}
(the vectors are the positions for the elevator for each floor)
The problem I was having was that no matter what button I clicked, the elevator would only move one floor at a time. For example, if I'm on first and I touch fourth, I move only to second. I have to touch it two more times to get to fourth.
My quick fix for this problem was to change the first and fourth floor buttons into down and up arrows (respectively), and that seems to work fine, but is there a way I can fix my script to use the four-button method I was looking for?
The elevator is here if you want to try it out for yourself:
http://slurl.com/secondlife/CIST%20Nebraska%20Omaha/86/181/31