User:Trinity Coulter/Random Message Script

From Second Life Wiki
< User:Trinity Coulter
Revision as of 14:13, 27 August 2008 by Trinity Coulter (talk | contribs) (New page: 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() { ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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>