07-27-2007, 09:08 AM

I was debating whether to start a general "please help mik with everything he doesn't understand" thread, since I think there will be a lot in the coming months, but I guess while the forums are still relatively slow I'll stick with one thread per subject.

The current thing I can't figure out is the math.random function, which I assume is supposed to return a pseudo-random number. However, it seems to return the same number every time.

If I use no argument the result is always 0.84018771715471

math.random(6) or math.random(1,6) always returns 6

math.random(1,12) always returns 11

...and on and on with these seemingy illogical results

Does this function not work the way it should, or am I just not understanding the Lua documentation?

The current thing I can't figure out is the math.random function, which I assume is supposed to return a pseudo-random number. However, it seems to return the same number every time.

If I use no argument the result is always 0.84018771715471

math.random(6) or math.random(1,6) always returns 6

math.random(1,12) always returns 11

...and on and on with these seemingy illogical results

Does this function not work the way it should, or am I just not understanding the Lua documentation?