Typical random seed value of os.time()
is not the best choice because between subsequent launches the seed value changes too little, resulting in similar random values.
There are better alternatives. The first is to get the seed value from a memory address of a temporary Lua table.
math.randomseed(tonumber(hash_to_hex(hash(tostring({}))):sub(4, 8), 16))
The second is to use the fractional part of socket.gettime()
math.randomseed(100000 * (socket.gettime() % 1))