1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
| /******************************************************************
* This example will change color when a BUTTON is selected.
* Your AVP_Positions notecard should have buttons for each color e.g.
*
* TOMENU Colors
* ...
* MENU Colors
* BUTTON Red|0
* BUTTON White|0
* BUTTON Blue|0
*
* This is a basic example to show concept only.
* If you need custom texture change you should contact your scripter.
******************************************************************/
list COLOR_NAMES = ["Red","White","Blue"];
list COLOR_VECTORS = [<1,0,0>,<1,1,1>,<0,0,1>];
default{
link_message(integer sender, integer num, string msg, key id){
integer index = llListFindList(COLOR_NAMES,[msg]);
if(~index){ // color button was pressed
if(id==llGetOwner()){ // it was owner
llSetColor(llList2Vector(COLOR_VECTORS,index),ALL_SIDES);
}
else{ // it was not owner
llRegionSayTo(id,0,"Sorry this is owner only.");
}
// give back the menu
llMessageLinked(LINK_SET,90005,"",id);//return menu
}
}
}
|