If you use the texture name, such as "window" in the llSetTexture call, then you must also include the texture in the object contents with the script. You can use the UUID of the texture instead, which is what I prefer to do, as it simplifies the permissions issues.
These will respond to anyone's touch, not just those you give permissions to. That is another level of complications I have not addressed.
CODE
//This script rotates between textures window and blind textures when touched.
default
{
touch_start(integer total_number)
{
llSetTexture("window",ALL_SIDES);//the texture shown in the default state is "window".
llSetAlpha(1.0,ALL_SIDES);//1.0 shows all of a texture, 0.0 shows none
llScaleTexture(1,1, ALL_SIDES);//adjusts texture scale if needed.
state blinds;
}
}
state blinds
{
touch_start(integer total_number)
{
llSetTexture("blinds",ALL_SIDES);
llSetAlpha(1.0,ALL_SIDES);
llScaleTexture(1,1, ALL_SIDES);
state default;
}
}
Here is another example rotating between 3 textures:
CODE
//This script rotates between textures 3 textures when touched.
default
{
touch_start(integer total_number)
{
llSetTexture("window",ALL_SIDES);//the texture shown in the default state is "window".
llSetAlpha(1.0,ALL_SIDES);//1.0 shows all of a texture, 0.0 shows none
llScaleTexture(1,1, ALL_SIDES);//adjusts texture scale if needed.
state blinds;
}
}
state blinds
{
touch_start(integer total_number)
{
llSetTexture("blinds",ALL_SIDES);
llSetAlpha(1.0,ALL_SIDES);
llScaleTexture(1,1, ALL_SIDES);
state stone;
}
}
state stone
{
touch_start(integer total_number)
{
llSetTexture("stone",ALL_SIDES);
llSetAlpha(1.0,ALL_SIDES);
llScaleTexture(1,1, ALL_SIDES);
state default;
}
}