lundi 1 mai 2023

i need help getting seed = os.clock to output a integer

I am trying to get a random number generation but keep getting this syntax.

lua5.3: Main.lua:3: bad argument #1 to 'random' (number has no integer representation)
stack traceback:
    [C]: in function 'math.random'
    Main.lua:3: in main chunk
    [C]: in ?

I tried to use this to get a random number but it doesn`t have a integer representation.

seed = os.clock()
print(seed)
e = math.random(seed)
print(e)



Aucun commentaire:

Enregistrer un commentaire