rewdew2
|
  |
| Joined: 10 Dec 2009 |
| Total Posts: 168 |
|
|
| 12 Aug 2014 07:25 PM |
Hi. How do i write the Math.random variables so it picks a random object from a script?
like... list = [{thing 1}, {thing 2}, {thing 3}] math.random(random thing off list)
Thanks in advance! |
|
|
| Report Abuse |
|
|
Stefan631
|
  |
| Joined: 23 Dec 2010 |
| Total Posts: 1350 |
|
|
| 12 Aug 2014 07:26 PM |
| list[math.random(1, #list)]; |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 12 Aug 2014 07:26 PM |
list = {"thing1", "thing2", "thing3"}; local random = list[math.random(#list)]; print(random); |
|
|
| Report Abuse |
|
|
rewdew2
|
  |
| Joined: 10 Dec 2009 |
| Total Posts: 168 |
|
| |
|