Great little sliding door script.integer es;
default
{
state_entry()
{
es = 0;
}
touch_start(integer total_number)
{
vector er = llGetScale();
if(es == 0)
{
llSetPos(llGetLocalPos() - <er.x*2,0,0>);
es = 1;
}
else
{
llSetPos(llGetLocalPos() + <er.x*2,0,0>);
es = 0;
}
}
}
If the door slides too far for your build change the number 2 in the
following code tag to something lower or higher depending on what
you require. <er.x*2,0,0>
So if the door is sliding too far with a 2 try 0.5 like this;
<er.x*0.5,0,0>
To reverse the direction just put a minus sign in front of the number
like this; <er.x*-1.25,0,0>.
Remember to modify the values in both statements.