ID:261565
 
i cant get it to pick a random #
rand(1,100000000000000000)
In response to Garthor
rand(1,2)
if(rand == 2)
usr:gold-=5
if(rand == 1)
usr:gold-=5

that is not working
In response to Nunugi
usr.gold -= pick(-5,5)

or...

if(pick(0,1))
usr << "you win!"
usr.gold += 5
else
usr << "you lose!"
usr.gold -= 5
In response to Nunugi
Nunugi wrote:
rand(1,2)
if(rand == 2)
usr:gold-=5
if(rand == 1)
usr:gold-=5

that is not working

It looks like you are trying to copy the structure of a switch. You would need to include the switch statement for it to work and modify the ifs a bit:

switch(rand(1,2))
if(2) usr:gold-=5
if(1) usr:gold-=5

That is the structure of a switch but there are still some potential problems. I don't think you want to subtract gold in both cases (assuming one case is wining, and the other is losing).

This also isn't a very efficient setup for the simple task it accomplishes but if you want to add complexity then it isn't necessarily a bad way to go.
In response to English
You can do it like this too
var/gain = rand(-5,5) //Define a var called gain pick-5to5
if(gain <= 0) //if the number is 0 or less..
usr.gold -= gain //subtract the amount
if(gain > 0) //if the number is greater than 0
usr.gold += gain //add the gold

In response to Weedman
Weed, where did you learn your math? X - (-5) = X+5, X + (+5) = X+5. In other words, your "equasion" results in usr.gold += rand(0,5)