View Single Post
  #3  
Old 12-19-2012, 06:01 PM
greggiles greggiles is offline
Registered User
greggiles's Avatar
Join Date: Sep 2007
Posts: 149
greggiles has a spectacular aura about
Quote:
PHP Code:
//#CLIENTSIDE
function onCreated() {
this.number = int(random(1,2.9))*5;//5 or 10
}
I used 2.9 because it generates a decimal number, so the occurance of 2 would be less if it was just 2.0
So if I were to be doing 1 or 3, itd be..

PHP Code:
this.number int(random(1,3)); 
Just tried what I wrote above..It draws 2.
I'm not too familiar with random integer scripts but of what I know that's not right because the only number between 1 and 3 is 2.
I need it to only pick from 1 or 3.

Last edited by greggiles; 12-19-2012 at 06:18 PM..
Reply With Quote