Show/Hide Prim by Sit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/******************************************************************
* This example will hide a prim whenever an avatar is sitting anywhere on the object.
* Place this script into the prim you want to make invisible.
* Will hide the prim whenever an avatar is sitting. Just swap the llSetAlpha() lines to do the opposite!
******************************************************************/
default{
changed(integer change){
if(change & CHANGED_LINK){
// if no avatars sitting
if(llGetAgentSize(llGetLinkKey(llGetNumberOfPrims()))==ZERO_VECTOR){
//make prim visible
llSetAlpha(1,ALL_SIDES);
}
// if avatars are sitting
else{
//make prim invisible
llSetAlpha(0,ALL_SIDES);
}
}
}
}