User:Trinity Coulter/Random Message Script

From Second Life Wiki
Jump to navigation Jump to search

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>