// Sliding door LSL script #1 // Handles the touch event. vector delta = <1.0, 0.0, 0.0>; // amount to move door // when we open it vector closed_position; // original position of the // door when closed // Processing for the script when it first starts up default { // What we do when we first enter this state state_entry() { closed_position = llGetPos(); // Save position when door is closed state closed; // Move to the closed state } } // Processing for the script when it is in the closed state state closed { // What we do when we first enter this state state_entry() { llSetPos(closed_position); // Move door to closed position } // What we do when the door is clicked ("touched") with the mouse touch_start(integer total_number) { state open; // Move to the open state } } // Processing for the script when it is in the open state state open { // What we do when we first enter this state state_entry() { llSetPos(closed_position + delta); // Move door to open position } // What we do when the door is clicked ("touched") with the mouse touch_start(integer total_number) { state closed; // Move to the closed state } }