Random Number from 1-500

how do you do a random number from 1-500?

math.round(math.random(1)*10); <-- that only goes from 0-10 lol…

i tried loops and stuff but it didnt work out… :confused: i also tried adding a buncha math.randoms but the number was always pretty high…

im using it for this
http://www.toon-network.com/first.html
click on the wack-a-mole title… thatz where im using the random thing… but half the time its off the screen since i used exponents…

I’m not sure on this… but if putting *10 goes from 0-10… wouldn’t *500 go from 0-500?

it would be

[AS]
Math.round(Math.random(1)*500);
[/AS]

just set it to a dynamic text box to try it. :slight_smile:

[AS]Math.floor(Math.random()*500)+1;[/AS]

o god was i stupid lol… **** why didnt i think of that instead of trying to do loops and stuff

thx


floor is the same thing as round… if i remeber it from c++ lol… floor just kills off the decimal places…