miscellaneous

Forum > Miscellaneous > I Need Programming Help! :p
Reply To Thread (login)
TheElect [29]
2011-12-14 03:57:30
[12 years, 349 days ago]

Im trying to make something similar to BOTS 4 but definitely not as good. Im trying to get a random from a range of two values, the thing is these values are variables not numbers.

var userbattledamage = Math.floor(Math.random() * usermaximumdamage) + userminimumdamage

when i try it out though, userbattledamage = NaN

any ideas?


 
Mithrandon [143]
2011-12-14 12:23:16
[12 years, 349 days ago]

have u defined usermaxdamage and usermindamage? like assignet with 0


 
TheElect [29]
2011-12-14 19:04:19
[12 years, 348 days ago]

oh nvm i worked it out :p thanks for caring :) just a simple mistake soz for all the trouble


 
Mithrandon [143]
2011-12-14 20:27:33
[12 years, 348 days ago]

no trouble only glad if i could be of any help


 
Alan [57]
2011-12-14 22:19:37
[12 years, 348 days ago]

isn't it Math.rand() ?


 
Made2shred [129]
2011-12-15 05:15:03
[12 years, 348 days ago]

you could use something like this (PHP): http://www.pure-paste.tk/view.php?h=LN80HcZo


 
Forum > Miscellaneous > I Need Programming Help! :p
Reply To Thread (login)