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 Door_quiet  

Door_quiet

Door quiet.lsl

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

the Zip file

Download all files for Door_quiet
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Door_quiet_1.lsl
1
2 // If door is locked, the name of the avatar who locked it.
3 // If door is not locked, the empty string ("").
4 string gLockedBy = "";
5
6 // This number must match the channel number of the lock
7 // and unlock objects you want to use. If multiple doors
8 // have the same channel, then a single lock can lock all of
9 // them at once.
10 integer gLockChannel = 243;
11
12 default
13 {
15 {
16 llSay(0, "Door 1.0");
17 llListen(gLockChannel, "", NULL_KEY, "");
18 state closed;
19 }
20 }
21
22 state closed
23 {
24 listen(integer channel, string name, key id, string message)
25 {
26 if(channel == gLockChannel)
27 {
28 if(message == "")
29 {
30 gLockedBy = "";
31 //llTriggerSound("door unlock", 10.0);
32 llSay(0, "unlocked");
33 }
34 else
35 {
36 gLockedBy = message;
37 //llTriggerSound("door lock", 10.0);
38 llSay(0, "locked");
39 }
40 }
41 }
42
43 touch_start(integer total_number)
44 {
45 string name = llDetectedName(0);
46 if(name == gLockedBy || gLockedBy == "")
47 {
48 llTriggerSound("Door open", 0.5);
49
50 rotation rot = llGetRot();
51 rotation delta = llEuler2Rot(<0,0,PI/4>);
52 rot = delta * rot;
53 llSetRot(rot);
54 llSleep(0.25);
55 rot = delta * rot;
56 llSetRot(rot);
57 state open;
58 }
59 else
60 {
61 llTriggerSound("Door knock", 0.5);
62 }
63 }
64 }
65
66 state open
67 {
69 {
70 llTriggerSound("Door close", 0.5);
71
72 rotation rot = llGetRot();
73 rotation delta = llEuler2Rot(<0,0,-PI/4>);
74 rot = delta * rot;
75 llSetRot(rot);
76
77 llSleep(0.25);
78 rot = delta * rot;
79 llSetRot(rot);
80
81 state closed;
82 }
83 }
84 // END //

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