|
| 08 Aug 2013 02:43 AM |
It's been a long time, and I haven't scripted in a while and I forgot how to pick a random item from a table.
gm = {"Normal","Chosen"}
How do I make it choose a random gm. I forgot XD |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 08 Aug 2013 02:45 AM |
| Um... I am starting to remember |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2013 02:46 AM |
| How do I make it, if it chose num1, this and that will happen, and if it chose num2, this and that will happen? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 08 Aug 2013 02:46 AM |
gm --table name [ --indexer open math.random( --random number method 1 --from 1 #gm --from the amount of values in gm ) --close ] --close |
|
|
| Report Abuse |
|
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 08 Aug 2013 02:49 AM |
local gm = {1, 2, "Z"} gm[1] = 1 gm[2] = 2 gm[3] = "Z"
math.random(1, 3) = 1 or 2 or 3 #gm = 3 math.random(1, #gm) = 1 or 2 or 3 gm[math.random(1, #gm)) = 1 or 2 or "Z" |
|
|
| Report Abuse |
|
|
| |
|