These forums are CLOSED. Please visit the new forums HERE
Need a script |
|
Mikey Mechanique
Mechanique Machinations
Join date: 16 Mar 2005
Posts: 5
|
04-12-2005 16:38
I need help making a script that will have an object say something random (chosen from a list) when touched. I'm just starting in learning how to do scripting, so all help would be appreciated.
|
Graham Mondrian
Registered User
Join date: 16 Mar 2005
Posts: 59
|
04-12-2005 16:49
Hey mikey, Heres a solution that randomly generates a list index.
CODE
|
Eloise Pasteur
Curious Individual
Join date: 14 Jul 2004
Posts: 1,952
|
04-13-2005 00:58
Alternatively the llListRandomize() function works (again) too.
Something like this might do. CODE
the wiki page for lists can help a lot, and will show you all of these functions in place. NB: I've not actually tried compiling this, but it ought to work. |
Hiro Pendragon
bye bye f0rums!
![]() Join date: 22 Jan 2004
Posts: 5,905
|
04-13-2005 01:23
Please note 2 things:
1. In the first reply, there was a forum bug... there should be no space in this line: llSay(0,llList2String(subject,llFloor(llFrand(llGe tListLength(subject)))))); 2. The randomizing list is far less efficient than the first example. _____________________
Hiro Pendragon
------------------ http://www.involve3d.com - Involve - Metaverse / Emerging Media Studio Visit my SL blog: http://secondtense.blogspot.com |
Hiro Pendragon
bye bye f0rums!
![]() Join date: 22 Jan 2004
Posts: 5,905
|
04-13-2005 01:26
Please note 2 things:
1. In the first reply, there was a forum bug... there should be no space in this line: llSay(0,llList2String(subject,llFloor(llFrand(llGe tListLength(subject)))))); 2. The randomizing list is far less efficient than the first example. _____________________
Hiro Pendragon
------------------ http://www.involve3d.com - Involve - Metaverse / Emerging Media Studio Visit my SL blog: http://secondtense.blogspot.com |