Announcement

Collapse
No announcement yet.

Math.Random Producing Repeating Results

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Math.Random Producing Repeating Results

    I've added Math.RandomSeed(os.time()); to my On Startup code but whenever I call Math.Random(6, 12), it always returns 12.
    I've looked on the forum and in the manual but did not see a solution. Also, I've tried this without seeding since the manual states that the app is seeded on startup; however, I get the same, repeating results. Why might this be occurring?

  • #2
    I figured it out. I call Random.Seed() several times after seeding, and now it works.

    Comment


    • #3
      http://lua-users.org/wiki/MathLibraryTutorial

      Comment

      Working...
      X