float SIT_ALPHA = 0.0 ;
float UNSIT_ALPHA = 1.0 ;
string TEXT="TEST TEXT";
string SITTEXT="";
vector col=< 1.0 , 1.0 , 1.0 >;
float transp= 1.0 ;
integer LAST=0;
integer GetNumberOfAgents(){
integer a = llGetNumberOfPrims();
integer b = a;
if(1 < a)
while(llGetAgentSize(llGetLinkKey(a)))
--a;
return b - a;
}
default {
state_entry() {
llSetAlpha(UNSIT_ALPHA, ALL_SIDES);
llSetText(TEXT, col, transp);
}
changed(integer change) {
if(change & CHANGED_LINK) {
integer na=GetNumberOfAgents();
if(na == 1 && !LAST ){
llSetAlpha(SIT_ALPHA, ALL_SIDES);
llSetText(SITTEXT, col, transp);
}
else if (!na) {
llSetAlpha(UNSIT_ALPHA, ALL_SIDES);
llSetText(TEXT, col, transp);
}
LAST=na;
}
}
on_rez(integer r) {
llResetScript();
}
}