What it does, is change the texture of an object whenever somebody comes near it:
Code: Select all
float distance=5.0; // Sets the distance the texture changes at
// Change txt1 to the name of the texture when no avatar is near and
// txt2 to the name of the texture when an avatar is near
list textures=["txt1","txt2"];
integer txtno;
default{
state_entry(){
llSensorRepeat("",NULL_KEY,AGENT,distance,PI,0.1);
}
sensor( integer detected ){
if(!txtno){
txtno=!txtno;
llSetTexture(llList2String(textures,txtno), ALL_SIDES);
}
}
no_sensor(){
if(txtno){
txtno=!txtno;
llSetTexture(llList2String(textures,txtno), ALL_SIDES);
}
}
}