
I have a "little" problem...
i have bought a house with an amazing door script. But the problem is ...only i can open the doors
and i wish that my SL family can open the doors to. Now i have also a door script that works with a notecard.Now i have tried to combine the 2 scripts meself for the last 2 weeks but to no avail

I really hope that someone can help me....PLZ...
the first one is the one that came with the house and the second one that with the notecard
For all those who are going to fiddle/help me with it...THX in advance!!!
this are the 2 scripts:
default
{
state_entry()
{
llListen(0, "", llGetOwner(), ""
;}
listen(integer channel, string name, key id, string message)
{
if (message == "lock"
{llSay(0, "locked"
;state locked;
}
}
touch_start(integer total_num)
{
llTriggerSound("Door open", 0.5);
rotation rot = llGetRot();
rotation delta = llEuler2Rot(<0,0,PI/4>
;rot = delta * rot;
llSetRot(rot);
llSleep(0.25);
rot = delta * rot;
llSetRot(rot);
state open;
}
}
state open
{
state_entry()
{
llSetTimerEvent(5);
llListen(0, "", llGetOwner(), ""
;}
listen(integer channel, string name, key id, string message)
{
if (message == "lock"
{llSay(0, "locked"
;state lockopen;
}
}
touch_start(integer total_num)
{
llTriggerSound("Door close", 0.5);
rotation rot = llGetRot();
rotation delta = llEuler2Rot(<0,0,-PI/4>
;rot = delta * rot;
llSetRot(rot);
llSleep(0.25);
rot = delta * rot;
llSetRot(rot);
state default;
}
timer()
{
llTriggerSound("Door close", 0.5);
rotation rot = llGetRot();
rotation delta = llEuler2Rot(<0,0,-PI/4>
;rot = delta * rot;
llSetRot(rot);
llSleep(0.25);
rot = delta * rot;
llSetRot(rot);
state default;
}
}
state locked
{
state_entry()
{
llListen(0, "", llGetOwner(), ""
;}
listen(integer channel, string name, key id, string message)
{
if (message == "unlock"
{llSay(0, "unlocked"
;state default;
}
}
touch_start(integer total_num)
{
if (llDetectedKey(0) == llGetOwner()) {
llTriggerSound("Door open", 0.5);
rotation rot = llGetRot();
rotation delta = llEuler2Rot(<0,0,PI/4>
;rot = delta * rot;
llSetRot(rot);
llSleep(0.25);
rot = delta * rot;
llSetRot(rot);
state lockopen;
} else {
llTriggerSound("Door knock", 0.5);
}
}
}
state lockopen
{
state_entry()
{
llListen(0, "", llGetOwner(), ""
;llSetTimerEvent(5);
}
listen(integer channel, string name, key id, string message)
{
if (message == "unlock"
{llSay(0, "unlocked"
;state open;
}
}
touch_start(integer total_num)
{
if (llDetectedKey(0) == llGetOwner()) {
llTriggerSound("Door close", 0.5);
rotation rot = llGetRot();
rotation delta = llEuler2Rot(<0,0,-PI/4>
;rot = delta * rot;
llSetRot(rot);
llSleep(0.25);
rot = delta * rot;
llSetRot(rot);
state locked;
}
}
timer()
{
llTriggerSound("Door open", 0.5);
rotation rot = llGetRot();
rotation delta = llEuler2Rot(<0,0,-PI/4>
;rot = delta * rot;
llSetRot(rot);
llSleep(0.25);
rot = delta * rot;
llSetRot(rot);
state locked;
}
}
-------------------------------------------------------------------------------------------
script with notecard
key nrofnamesoncard;
integer nrofnames;
list names;
list keynameoncard;
string nameoncard;
string storedname;
default
{
state_entry()
{
llOwnerSay("Startup state reading whitelist notecard"
;nrofnamesoncard = llGetNumberOfNotecardLines("whitelist"
; }
dataserver (key queryid, string data){
if (queryid == nrofnamesoncard)
{
nrofnames = (integer) data;
llOwnerSay("Found "+(string)nrofnames+ " names in whitelist."
;integer i;
for (i=0;i < nrofnames;i++){
keynameoncard += llGetNotecardLine("whitelist", i);
}
} else
{
integer listlength;
listlength = llGetListLength(keynameoncard);
integer j;
for(j=0;j<listlength;j++) {
if (queryid == (key) llList2String(keynameoncard,j))
{
llOwnerSay("Name added to whitelist: "+data);
names += data;
}
}
}
if (llGetListLength(names) == nrofnames)
{
llOwnerSay ("Read the complete notecard going to state closed now. Finished configuration"
;state closed;
}
}
}
state closed
{
state_entry()
{
llListen(2,"",llGetOwner(),""
;}
touch_start(integer total_number)
{
integer j;
for (j=0;j<llGetListLength(names);j++)
{
if (llList2String(names, j) == llDetectedName(0)){
vector test;
rotation rot;
test.x = 0;
test.y = 0;
test.z = 0.5 * PI;
rot = llEuler2Rot(test);
llSetRot(rot);
state open;
}
}
}
}
state open
{
state_exit()
{
integer j;
for (j=0;j<llGetListLength(names);j++)
{
if (llList2String(names, j) == storedname){
vector test;
rotation rot;
test.x = 0;
test.y = 0;
test.z = 0 * PI;
rot = llEuler2Rot(test);
llSetRot(rot);
}
}
}
touch_start(integer total_number)
{
storedname = llDetectedName(0);
state closed;
}
}
----------------------------------------------------------------------------