random script problem

random script problem

jackietsteh
Advocate Advocate
519 Views
3 Replies
Message 1 of 4

random script problem

jackietsteh
Advocate
Advocate

Hi guys, i have problem with my random script, hoping someone can help me out.

 

i have create 2 spinners ( 1 spinner for set minimum value, 1 spinner for set maximum value) and 1 button for click to process in my rollout, when i set 1500 for minimum value and 3000 for maximum value and press the button, it work! except the random is incorrect, some value are below 1500, and some are above 3000??

 

how can i make the random value according or in between the range value?(in this example in between 1500 to 3000 ) and not below it or above it...

 

sorry about my poor english.

 

Regards,

Jackie

Best regards,
Jackie Teh
Portfolio: http://www.coroflot.com/jackieteh
Youtube Channel:https://www.youtube.com/user/jackieteh
0 Likes
520 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

Hello,

 

Not sure what are you using but random() should do the trick.

From documentation:

random <number> <number>

Returns a pseudo random number inclusively between the two arguments. Return value type is the type of the first argument.

Message 3 of 4

jackietsteh
Advocate
Advocate
Hi jeziorsk.jakub, thank you for reply, i have solved by put "zero" for the minimum value, don't know why cannot set minimum value to 1500....

my idea for the script is i want to limit the minimum and maximum range in between 1500 and 3000, but it not work?? any idea??
Best regards,
Jackie Teh
Portfolio: http://www.coroflot.com/jackieteh
Youtube Channel:https://www.youtube.com/user/jackieteh
0 Likes
Message 4 of 4

Anonymous
Not applicable

Hello,

 

I cannot replicate it. This line

random 1500 3000

 gives me strictly values in [1500, 3000] range. Maybe values you pass are not valid?

0 Likes