![]() |
Random?
How would I make a random integer?
Like for chance... It needs to say a RANDOM number. PHP Code:
|
random(lownumber,highnumber);
combined with int(val); To get a random int between 0 and 5, for example: int(random(0,5.9999)); I suggest putting the 9's there for any of the integer-related random numbers, otherwise the chances of the high number showing up are slim to none. |
this.chat = int(random(0,100)+.5);
|
Quote:
|
Quote:
|
Quote:
That does look cleaner, but I suggest getting as close to +1 as reasonably possible. with only +0.5, there's a ~0.5 out of 5 chance that it will actually roll he high number. Which is why you should, at the very least, tag +0.99 at the end. add more 9's the more important it is. |
Quote:
|
Quote:
|
| All times are GMT +2. The time now is 06:05 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.