// Door authorization LSL script #1 // Handles the touch event. // Handles partial transparency when the door is in phantom mode. // Allows only the owner to open the door // Processing for the script when it first starts up float alpha = 0.75; // alpha value for partial transparency // of the door when in phantom mode. // 1.0 is solid, 0.0 is transparent. default { // What we do when we first enter this state state_entry() { 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() { llSetStatus(STATUS_PHANTOM,FALSE); // Turn off phantom property llSetLinkAlpha(LINK_SET, // Turn off transparency 1.0, ALL_SIDES); } // What we do when the door is clicked ("touched") with the mouse touch_start(integer total_number) { // If the door was clicked by the owner of the door, open it, // otherwise give a message. if (llGetOwner() == llDetectedKey(0)) { state open; // Move to the open state } else { llSay(0, "Sorry, "+llDetectedName(0)+", this door can only be opened by the owner."); } } } // Processing for the script when it is in the open state state open { // What we do when we first enter this state state_entry() { llSetStatus(STATUS_PHANTOM,TRUE); // Turn on phantom property llSetLinkAlpha(LINK_SET, // Turn on partial transparency alpha, ALL_SIDES); } // What we do when the door is clicked ("touched") with the mouse touch_start(integer total_number) { state closed; // Move to the closed state } }