llSetTexture <-- changes textures
llSetAlpha <-- changes the alpha (transparency) of an object or texture
llSetTextureAnim <--- changes the animation of a texture if you want it to move
llScaleTexture <-- changes the scale of the texture on the object, the repeats
llSetColor <-- changes the color
I apologize I have not been able to test the compilation of these in world since today is an upgrade day.
THIS EXAMPLE CHANGES BETWEEN TWO TEXTURES:
CODE
//Touch texture chage using states, by ArchTx Edo
//Rotates between two textures each time it is touched.
//If you use the texture name, it must be include in the prim with the script.
//You can use the UUID for the texture instead of the name if you don't want to include the texture in the prim.
default
{
touch_start(integer total_number)
{
llSetTexture("texture1",ALL_SIDES); //insert texture name or UUID where it says texture1
llSetAlpha(0.1,ALL_SIDES);//0.1 shows little of the texture
llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, ALL_SIDES, 1, 1, 0, 0, 0); //this may not work as expected
llScaleTexture(1,1, ALL_SIDES);
llSetColor(<1,1,1>,ALL_SIDES); state texture2; //set color works on a 0 to 1 RGB basis, not 0 to 255
}
}
state texture2
{
touch_start(integer total_number)
{
llSetTexture("texture2",ALL_SIDES); //insert texture name or UUID where it says texture2
llSetAlpha(0.1,ALL_SIDES);//0.1 shows little of the texture
llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, ALL_SIDES, 1, 1, 0, 0, 0); //this may not work as expected
llScaleTexture(1,1, ALL_SIDES);
llSetColor(<1,1,1>,ALL_SIDES); state default; //set color works on a 0 to 1 RGB basis, not 0 to 255
}
}
THIS EXAMPLE CHANGES BETWEEN THREE TEXTURES:
CODE
//Touch texture chage using states, by ArchTx Edo
//Rotates between three textures each time it is touched.
//If you use the texture name, it must be include in the prim with the script.
//You can use the UUID for the texture instead of the name if you don't want to include the texture in the prim.
default
{
touch_start(integer total_number)
{
llSetTexture("texture1",ALL_SIDES); //insert texture name or UUID where it says texture1
llSetAlpha(0.1,ALL_SIDES);//0.1 shows little of the texture
llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, ALL_SIDES, 1, 1, 0, 0, 0); //this may not work as expected
llScaleTexture(1,1, ALL_SIDES);
llSetColor(<1,1,1>,ALL_SIDES); state texture2; //set color works on a 0 to 1 RGB basis, not 0 to 255
}
}
state texture2
{
touch_start(integer total_number)
{
llSetTexture("texture2",ALL_SIDES); //insert texture name or UUID where it says texture2
llSetAlpha(0.1,ALL_SIDES);//0.1 shows little of the texture
llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, ALL_SIDES, 1, 1, 0, 0, 0); //this may not work as expected
llScaleTexture(1,1, ALL_SIDES);
llSetColor(<1,1,1>,ALL_SIDES); state texture3; //set color works on a 0 to 1 RGB basis, not 0 to 255
}
}
state texture3
{
touch_start(integer total_number)
{
llSetTexture("texture3",ALL_SIDES); //insert texture name or UUID where it says texture3
llSetAlpha(0.1,ALL_SIDES);//0.1 shows little of the texture
llSetTextureAnim(ANIM_ON | SMOOTH | LOOP, ALL_SIDES, 1, 1, 0, 0, 0); //this may not work as expected
llScaleTexture(1,1, ALL_SIDES);
llSetColor(<1,1,1>,ALL_SIDES); state default; //set color works on a 0 to 1 RGB basis, not 0 to 255
}
}