05-27-2006 20:36
Hi all,

My prefab houses are experiencing problems in 1.10 where no probs existed before.

Specifically, I have some doors with open/close switches that cease to function once the whole house they are linked to is rotated at all after rezzing. Any ideas why?

Heres the Door Switch script, followed by the Door Target script


### DOOR SWITCH SCRIPT###

integer on; //is the switch on?

default
{



state_entry()
{
llSay(0, "Click to Open The Door";);
}


touch_start(integer total_number)
{
if (on == 0)
{
on =1;//now it's on
llShout(1003, "Door Opened";);
}

else if (on == 1)

if (on == 1)
{
on =0;//now it's off
llShout(1003, "Door Closed";);
}
}
}



####DOOR TARGET SCRIPT###

integer listener; //handle for the listen

open()
{

vector target = origpos + newpos;
while (llVecDist(llGetLocalPos(), target) > 0.001) llSetPos(target);
llSetTimerEvent(20);

}


close()
{

vector target = origpos;
while (llVecDist(llGetLocalPos(), target) > 0.001) llSetPos(target);
llSetTimerEvent(0);
}


vector origpos;
vector newpos = <0,0,4>;

default
{
state_entry()
{
llListen(1003,"",NULL_KEY,"";);
origpos = llGetLocalPos();
}

timer()
{
close();
}

listen(integer channel, string name, key id, string message)
{
if (message=="Door Opened";)
{
open();
}

else if (message=="Door Closed";)
{
close();
}
}
}