25.07.2018, 07:33
A better way to explain how you solve it, is to look at the problem part for part.
You want the ranom to start at 500, and end at 1000. Between 500 and 100 you have 500 units.
If you want another range, lets say you want a random value between 75-94?
This is also basically what the function posted by "Coool" above does, but in a shorter format. I just thought you wanted to know why it worked.
You want the ranom to start at 500, and end at 1000. Between 500 and 100 you have 500 units.
PHP код:
new money = 500; //This will make it "always" start at 500
money = money + random(500); //then, reinitialize the variable. Tell the script that you want 500 + '0-500' more.
PHP код:
new money = 75;
money = money + random(19); //this will always be 75-94.