question to math.random

User avatar
tkerwel
Member
 
Posts: 213
Joined: Fri Jan 13, 2012 07:35

question to math.random

by tkerwel » Mon Jul 09, 2012 11:30

in the moment i tortue my brain (at least the rest which is function in my age...)

i need a random number between x and z.

when i use math.random (x,z) so i get a number between x and z, but this is not a real random number, every start its the same numer again.

so when i use math.random (0, os.time()) i ot a large number beween 0 and os.time...

any idea what i can do to get that down like 1 to 6 ?
++++ Kung walang tiyaga, walang nilaga. ++++
 

User avatar
mauvebic
Member
 
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Mon Jul 09, 2012 11:34

you need to add this before running random

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
math.randomseed(os.time())
"Fuck the hat." - Paulie Gualtieri
 

User avatar
tkerwel
Member
 
Posts: 213
Joined: Fri Jan 13, 2012 07:35

by tkerwel » Mon Jul 09, 2012 11:58

thanks...

or

danke schön ...

so easy...was already try to doi that with a loop with rondom wide an inside i always use math.random.... jesus i did not see the tree inside the wood... (old german saying...translation sounds a bit silly *gg* )
++++ Kung walang tiyaga, walang nilaga. ++++
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 6 guests

cron