generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How to truly achieve random numbers?

Previous Thread :: Next Thread 
ikabodbubwit is online. ikabodbubwit
Joined: 14 Dec 2010
Total Posts: 11
21 Jun 2017 10:04 AM
I want to have a different number every time math.random() generates a different number, not the same number everytime like math.randomseed(tick()) or math.random()

Any help?
Report Abuse
ExtremeBuilder15 is online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 3176
21 Jun 2017 10:10 AM
I think you could send an #### request to ########### but I've never done that so I can't tell you how to do it :(
Report Abuse
ExtremeBuilder15 is online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 3176
21 Jun 2017 10:11 AM
google random number generator. It's the first web result

Report Abuse
Lightning_Dev is not online. Lightning_Dev
Joined: 24 Feb 2016
Total Posts: 380
21 Jun 2017 11:22 AM
http://wiki.roblox.com/index.php?title=Random_numbers


Report Abuse
BJCarpenter is online. BJCarpenter
Joined: 04 Nov 2008
Total Posts: 4416
21 Jun 2017 11:38 AM
if u put math.randomseed(tick()) at the top of your script, once; the resulting list will truly be random.

Want more random:
Do what electronic slot machines do: Be constantly pulling randoms from the list in the background. When Player calls for a random at some random time; truly random....

while wait(.1)
a = math.random()
end
Report Abuse
ikabodbubwit is online. ikabodbubwit
Joined: 14 Dec 2010
Total Posts: 11
21 Jun 2017 12:49 PM
I already put randomseed(tick()) at the top, i did this:

math.randomseed(tick())

Part = game.workspace.Part
x = math.random(1,100)
z = math.random(1,100)
boxChance = math.random(1,100)

while wait() do
print(Part,x,z,boxChance)
end

and the output was this:

Part 25 28 84 (x109)
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
21 Jun 2017 01:12 PM
It doesn't work that way.
You need to pick a random number each time or of course they'll all be the same.

math.randomseed(tick())

while wait() do
Part = game.workspace.Part
x = math.random(1,100)
z = math.random(1,100)
boxChance = math.random(1,100)
print(Part,x,z,boxChance)
end


Report Abuse
ikabodbubwit is online. ikabodbubwit
Joined: 14 Dec 2010
Total Posts: 11
21 Jun 2017 01:58 PM
Thanks for the help!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image