Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Door AirLock_Door_Script  

AirLock_Door_Script

Air-Lock Door Script.lsl

Category: Door
By : Mitzpatrick Fitzsimmons
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for AirLock_Door_Script
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. AirLock_Door_Script_1.lsl
1
2 //__________________________________________________ ___________________
3
4 //Air-Lock Door Script by Mitzpatrick Fitzsimmons
5 //********************** DESCRIPTION *************************
6 // This door script differs from most, as it uses the
7 // llSetPrimativeParams function to simulate an open
8 // or closed door. It can be used with any Prim Type,
9 // however, the script will need to be modified slightly.
10 // I find the best effect is with BOX or CYLINDER, as it
11 // reminds me of a Star-Trek type operation.
12 // The benefits with this type of door is that no rotation
13 // factors need to be calculated (as there is no real movement)
14 // but it might not be the best solution for a "HOUSE-TYPE" door.
15 // I use this on my space-ship, and it looks pretty cool IMHO.
16 // Note that the prim you use will need to be rotated 90 on the
17 X// or Y axis for a door that you would walk through, or if you plan
18 // to jump/fly through you can leave it as is.
19
20 // This script is set to the owners chat commands on channel 1
21 // but can easily be modified to a touch responce or other method.
22
23 // Feel free to modify this script as you see fit, and NO you
24 // dont need to give me any credit, OR leave this 'EXTRA-LONG'
25 // DESCRIPTION in it....heheh :)
26
27
28
29 //---------------------------------------------------------------------------------- GLOBAL VARIABLES
30
31 // I find it is easier to copy the UUID of your sounds and then set them as Globals rather than to have
32 // mulitple copies stuffed inside your prims... just a thought. You dont need to use sounds, but it's more fun.
33
34 key DOOR_OPEN_SOUND=" "; //Paste the UUID of your favorite door sound between the quotes
35 key DOOR_CLOSE_SOUND=" "; //Paste the UUID of your favorite door sound between the quotes
36
37 //---------------------------------------------------------------------------------- FUNCTIONS
38
39 OPEN_DOOR() {
40 llPlaySound(DOOR_OPEN_SOUND, 1);
41 llWhisper(0, "Door open!");
42 // Here is where the door open effect comes into play. the setting is 0.60 (just above half) play around with it to suit your needs.
43
44 llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_CYLINDER, 0, <0.0, 1.0, 0.0>, 0.60, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>]);
45 }
46
47 CLOSE_DOOR() {
48 llPlaySound(DOOR_CLOSE_SOUND, 1);
49 llWhisper(0, "Door closed!");
50 llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_CYLINDER, 0, <0.0, 1.0, 0.0>, 0.0, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>]);
51 }
52
53 //---------------------------------------------------------------------------------- MEAT & POTATOES
54
55 default
56 {
57 state_entry() {
58 llListen(1,"",llGetOwner(),""); // Listens for the OWNER on channel 1
59 llSay(0, "Activated"); // Just something I use to know the door is working. You can leave this out if you want.
60 }
61
62
63 listen(integer channel, string name, key id, string message) {
64
65 if(id==llGetOwner()) { // WE WILL ONLY LISTEN TO THE OWNER
66 if( message == "open door1" ) { // I number doors so I can call on just one specific door at a time
67 OPEN_DOOR();
68 }
69
70 if( message == "open all" ) { // For multiple doors to open simutaneously
71 OPEN_DOOR();
72 }
73
74 if( message == "close door1" ) {
75 CLOSE_DOOR();
76 }
77
78 if( message == "close all" ) {
79 CLOSE_DOOR();
80 }
81
82 }else
83 {
84 llSay(0, "You are not the OWNER." ); // In case someone else trys to open your door
85 }
86 }
87 }// END //

Back to the Best Free Tools in Second Life and OpenSim.