Math is a standard library in LUA. You can use math.random(min, max) to generate pseudo random numbers. I'd recommend you to use math.randomseed(os.ostime()) once to alter the permutations of your random numbers before using math.random.