User:Trinity Coulter/Random Message Script

From Second Life Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The following script will say a random message when clicked.

<lsl> list manysayings = ["Message 1","Message 2","Message 3"];

float num_sayings;

default {

   state_entry()
   {
       num_sayings = llGetListLength(manysayings);
   }
   touch_start(integer total_number)
   {
       integer saying2say = llFloor(llFrand(num_sayings));
       llSay(0, llList2String(manysayings,saying2say));
   }

} </lsl>