I've managed to cobble together a door script I like, works perfectly. But I would really like to be able to make it work with double doors so that both doors are linked together and open together at the same time. Now, before you ask, I have spent hours and hours reading everything I can find - and I've played with the pertinent portion of the Timeless Door Script. But I just can't get it to work. I know how to link the two doors together. What I can't figure out is how to click on one door and make them both open seperately but together (instead of not at all or as one big hinge). Can someone give me some simply explained help with making this script work to do what I want?
// DOOR SCRIPT
float CLOSE_TIME = 5.0;
integer DIR = -1;
integer OPEN = 1;
integer CLOSE = 2;
vector mypos;
door(integer A) {
rotation rot;
rotation delta;
llSetTimerEvent(0);
if ( A == OPEN ) {
rot = llGetRot();
delta = llEuler2Rot(<0, 0, -DIR * PI_BY_TWO>
;rot = delta * rot;
llSetRot(rot);
} else if ( A == CLOSE) {
rot = llGetRot();
delta = llEuler2Rot(<0, 0, DIR * PI_BY_TWO>
; rot = delta * rot;
llSetRot(rot);
}
}
default {
on_rez(integer B) {
llResetScript();
}
state_entry() {
mypos = llGetPos();
}
touch_start(integer total_number) {
door(OPEN);
state is_open;
}
moving_end() {
mypos = llGetPos();
}
}
state is_open {
state_entry() {
llSetTimerEvent(CLOSE_TIME);
}
touch_start(integer num) {
door(CLOSE);
llSetPos(mypos);
state default;
}
timer() {
door(CLOSE);
llSetPos(mypos);
state default;
}
moving_start() {
door(CLOSE);
state default;
}
}
