Rotating door with button

From The SchomEmunity Wiki
Jump to: navigation, search

Rotating airlock door with button. Rotates a door after a button press from a linked prim. Can have as many buttons as you want. The root prim must be the button (or one of if there are multiple buttons). As implemented in schome park beta.

//17/1/08
//made by olly butters
//rotating airlock - the door.

default
{
    state_entry()
    {
        llSay(0, "I have begun!");
    }

    link_message(integer source, integer which_door, string str, key id)
    {
        float angle_to_rotate_by = 180.0;
        angle_to_rotate_by = angle_to_rotate_by*DEG_TO_RAD;
        vector angles_in_radians = <0.0, 0.0, angle_to_rotate_by>;
        rotation rot_xyzq = llEuler2Rot(angles_in_radians); // Change to a Rotation
        llSetRot(llGetRot()*rot_xyzq);
    }
}
//17/1/08
//made by olly butters
//the button that opens the door.

default
{
    state_entry()
    {
        llSay(0, "Button1 started");
    }
    
    touch_start(integer total_number)
    {
        llMessageLinked(LINK_ALL_OTHERS,1,"open","");
    }
}