Hi, Great script. Thanks.
Does anyone know how to add an opening and closing sound to this.
I've tried by adding the following (not my own code) to your script
// change four lines underhere to change sound or volume
// change the open sound string to set another opening sound
string OpenSound = "cb340647-9680-dd5e-49c0-86edfa01b3ac";
float OpenVol = 1.0; // change to set opening volume
//change the close sound string to change sound or volume
string CloseSound = "e7ff1054-003d-d134-66be-207573f2b535";
float CloseVol = 1.0; // change to set close volume
float ScaleMove;
integer slideDir;
integer openDir;
integer isOpen;
key handle;
list scale;
string ScaleFull;
string ownerName;
string secretWord = "A1door1"; // This is a word that will be sent to the door with the open command,
// This way, only the doors you want this trigger to open will open,
// Please note, you must also set this veriable in the door you want to open;
vector openPos;
vector closePos;
init()
{
slideDir = 0; // 0 = X, 1 = Y, 2 = Z
openDir = 1; // 0 = "-", 1 = "+"
ScaleFull = (string) llGetScale();
scale = llParseString2List(ScaleFull, ["<", ", ", ">"] , []);
ScaleMove = llList2Float(scale, slideDir) * 0.7;
closePos = llGetLocalPos();
if (!slideDir) { openPos = <ScaleMove, 0, 0>; }
if (slideDir == 1) { openPos = <0, ScaleMove, 0>; }
if (slideDir == 2) { openPos = <0, 0, ScaleMove>; }
if (openDir)
{
if (!slideDir) { openPos = <ScaleMove, 0, 0>; }
if (slideDir == 1) { openPos = <0, ScaleMove, 0>; }
if (slideDir == 2) { openPos = <0, 0, ScaleMove>; }
} else {
if (!slideDir) { openPos = <-ScaleMove, 0, 0>; }
if (slideDir == 1) { openPos = <0, -ScaleMove, 0>; }
if (slideDir == 2) { openPos = <0, 0, -ScaleMove>; }
}
openPos = llGetLocalPos() + openPos;
ownerName = llKey2Name(llGetOwner());
llListen( 16, "", NULL_KEY, "" );
}
openDoor()
{
isOpen = 1;
llSetPos(openPos);
if(OpenSound != ""

llTriggerSound(OpenSound, OpenVol);
llSetTimerEvent(0);
}
closeDoor()
{
isOpen = 0;
llSetPos(closePos);
if(CloseSound != ""

llTriggerSound(CloseSound, CloseVol);
llSetTimerEvent(0);
}
default
{
state_entry()
{
init();
}
listen(integer channel, string name, key id, string message)
{
if (message == ownerName + " " + secretWord + " " + "SLIDE OPEN"

{
openDoor(); llSetTimerEvent(2);
}
}
timer()
{
closeDoor();
}
}
It sort of works but the sound keeps repeating as you step over the second trigger on the other side of the door.
Any ideas greatly appreciated. I'm slowely learning to pull this code stuff apart and it's beinging to make sense.