![]() |
Random Variables
I am doing some mining type stuff for my server and i got the triggeraction stuff working to destroy rocks and stuff. But for the rocks i figure they could leave things behind sometimes like a little diamond or something. And I need help setting it to pick a random variable. So could some one help me. Like ... say it picks a random number between 1-1000 and if you get a 483 it lays a diamond. Could someone please help me.
|
use
i = random(0,999); then have stuff like if (i >50&&i<101) { stuffhere; |
kool
kool i'll try it thanx ...
|
you can do it a lot of ways
this.random = random(1,90); |
~AlphaFlame~
Quote:
Quote:
|
ended
what i just ended up doing was ....
this.destroy=random(1,1000); if (this.destroyed=483) { putnpc diamond.gif,diamond.txt,32,32; } I know the ending probably aint right but i am just explaining what i did and dont care if its wrong ... |
I think there is still a bug in random() in where it doesn't get re-randomized if you don't move...
|
Quote:
PHP Code:
|
| All times are GMT +2. The time now is 08:15 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.