xboxscene.org forums

Author Topic: Could Someone Tell Me How To Get A Random #  (Read 331 times)

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Could Someone Tell Me How To Get A Random #
« on: February 09, 2004, 05:49:00 AM »

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
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
Could Someone Tell Me How To Get A Random #
« Reply #1 on: February 09, 2004, 06:04:00 AM »

It's "$rand$"

Used with MOD of 51, it should give you a number from 0-51
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Could Someone Tell Me How To Get A Random #
« Reply #2 on: February 09, 2004, 06:07:00 AM »

Like this,

SET jump $rand$
MOD jump 51
Logged

BenJeremy

  • Archived User
  • Hero Member
  • *
  • Posts: 5645
Could Someone Tell Me How To Get A Random #
« Reply #3 on: February 09, 2004, 06:23:00 AM »

yes.
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Could Someone Tell Me How To Get A Random #
« Reply #4 on: February 09, 2004, 06:28:00 AM »

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.
Logged

geniusalz

  • Archived User
  • Hero Member
  • *
  • Posts: 1635
Could Someone Tell Me How To Get A Random #
« Reply #5 on: February 09, 2004, 12:19:00 PM »

It shouldn't be giving you any negative numbers huh.gif
Logged

flattspott

  • Archived User
  • Hero Member
  • *
  • Posts: 1220
Could Someone Tell Me How To Get A Random #
« Reply #6 on: February 09, 2004, 02:15:00 PM »

Well after I finish up the basics of my newest script ConfigSwitch I post the section so someone can correct me. wink.gif
Logged