Help - Search - Members - Calendar
Full Version: Could Someone Tell Me How To Get A Random #
Scenyx Entertainment Community > Xbox1 Forums > Dashboard Forums > Official MediaXMenu (MXM) Forum > MXM ActionScripting Forum
flattspott
I see in the ActionScript readme there's $random$, but in the internal.xml I see just $rand$. What I want is to be able to get a random # from 0 to 50. No more, no less.

Incase you must know why, it's for my NewsChanger Script
BenJeremy
It's "$rand$"

Used with MOD of 51, it should give you a number from 0-51
flattspott
Like this,

SET jump $rand$
MOD jump 51
BenJeremy
yes.
flattspott
Thanks, that was what I wanted, now I just have to throw some ifs in there to keep it from going to a negative number and I'll be set.
geniusalz
It shouldn't be giving you any negative numbers huh.gif
flattspott
Well after I finish up the basics of my newest script ConfigSwitch I post the section so someone can correct me. wink.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.