Kinnis97
|
  |
| Joined: 21 Feb 2010 |
| Total Posts: 1683 |
|
|
| 27 Apr 2014 03:41 PM |
| math.randomseed(tick()) doesn't work the slightest, tried it countless times. |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2014 03:52 PM |
you're not using math.randomseed() right then.
#nerdsunited |
|
|
| Report Abuse |
|
|
Kinnis97
|
  |
| Joined: 21 Feb 2010 |
| Total Posts: 1683 |
|
|
| 27 Apr 2014 04:45 PM |
There's 10 maps. It always only chooses two. The script makes it unable to choose the same map twice, so it just repeats between the two.
math.randomseed(tick()) wait() choose = true mapDirectory = game.ServerStorage.MAPS maps = mapDirectory:getChildren() while choose == true do pickedMap = maps[math.random(1, #maps)] wait() if pickedMap.ID.Value == game.Workspace.LastMap.Value then print("Choosing another map..") wait() else print("Map chosen!") choose = false end end game.Workspace.LastMap.Value = pickedMap.ID.Value local pickedMapClone = pickedMap:clone() pickedMapClone.Parent = game.Workspace pickedMapClone:makeJoints() script.Parent.ready.Value = true script.Disabled = true
|
|
|
| Report Abuse |
|
|
Kinnis97
|
  |
| Joined: 21 Feb 2010 |
| Total Posts: 1683 |
|
| |
|
Kinnis97
|
  |
| Joined: 21 Feb 2010 |
| Total Posts: 1683 |
|
| |
|
Kinnis97
|
  |
| Joined: 21 Feb 2010 |
| Total Posts: 1683 |
|
| |
|
|
| 27 Apr 2014 06:02 PM |
| Well it will never be TRULY random. |
|
|
| Report Abuse |
|
|
Kinnis97
|
  |
| Joined: 21 Feb 2010 |
| Total Posts: 1683 |
|
|
| 27 Apr 2014 06:26 PM |
| math.randomseed(tick()) is meant to at least break any patterns. |
|
|
| Report Abuse |
|
|
| |
|
Kinnis97
|
  |
| Joined: 21 Feb 2010 |
| Total Posts: 1683 |
|
|
| 27 Apr 2014 06:45 PM |
It doesn't in my case. Go to my game, Stop it Slender, and try to tell me the map rotation doesn't constantly repeat the same 2-3 maps. |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2014 06:46 PM |
httpservice random(DOT)org json fun
i'm asian |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2014 06:47 PM |
@jigg
Never thought of that. Should make that a project. |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2014 06:48 PM |
because math.random() is a PRNG (mersenne twister probably) and randomDOTorg is a TRNG from thermal noise or something
i'm asian |
|
|
| Report Abuse |
|
|
L0cky2013
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 1446 |
|
|
| 27 Apr 2014 06:52 PM |
| Do you literally expect it to be different every time? If you do then it isn't random... obviously the more things you have to choose form, it will choose things more randomly |
|
|
| Report Abuse |
|
|
Kinnis97
|
  |
| Joined: 21 Feb 2010 |
| Total Posts: 1683 |
|
|
| 27 Apr 2014 06:59 PM |
@L0ck; I don't even know what you're talking about..
@Jigg; I've heard of this before, but I'm confused how to use it. |
|
|
| Report Abuse |
|
|
L0cky2013
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 1446 |
|
|
| 27 Apr 2014 07:00 PM |
| It wouldn't be random if you want it to be different every time |
|
|
| Report Abuse |
|
|
L0cky2013
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 1446 |
|
|
| 27 Apr 2014 07:01 PM |
@kinnis,
api.random. org/ json-rpc/ 1/ |
|
|
| Report Abuse |
|
|
Kinnis97
|
  |
| Joined: 21 Feb 2010 |
| Total Posts: 1683 |
|
|
| 27 Apr 2014 07:09 PM |
| I'm not sure if you're trying to avoid the link filter or what?... |
|
|
| Report Abuse |
|
|
Kinnis97
|
  |
| Joined: 21 Feb 2010 |
| Total Posts: 1683 |
|
| |
|
Kinnis97
|
  |
| Joined: 21 Feb 2010 |
| Total Posts: 1683 |
|
| |
|
|
| 27 Apr 2014 11:04 PM |
use httpservice RANDOM(DOT)ORG
i'm asian |
|
|
| Report Abuse |
|
|
Kinnis97
|
  |
| Joined: 21 Feb 2010 |
| Total Posts: 1683 |
|
|
| 28 Apr 2014 02:18 AM |
| I've never used httpservice or know where to put "RANDOM(DOT)ORG". |
|
|
| Report Abuse |
|
|
Kinnis97
|
  |
| Joined: 21 Feb 2010 |
| Total Posts: 1683 |
|
|
| 28 Apr 2014 02:46 PM |
| Guys I'm trying to get math.randomseed(tick()) to work properly, not find other methods of random numbers. |
|
|
| Report Abuse |
|
|
|
| 28 Apr 2014 02:57 PM |
It would be a problem with the seed if it chose the same maps in the same order every time (eg. 3, 5, 2, 8, 5, 8, restart, play again, 3, 5, 2, 8, 5, 8, rinse and repeat).
If it's a problem with picking the same two maps repeatedly... then the problem is that it "thinks" there's only two maps.
I can't be sure what the exact problem is, it's been a long time since I've actually scripted, but I hope I help at least a little. |
|
|
| Report Abuse |
|
|
samy22
|
  |
| Joined: 28 Sep 2008 |
| Total Posts: 2181 |
|
|
| 28 Apr 2014 03:12 PM |
--This is as random as i can make it with reference to the wiki on random numbers, try this?
math.randomseed(tick()) wait() choose = true mapDirectory = game.ServerStorage.MAPS maps = mapDirectory:getChildren() while choose == true do pickedMap = maps[math.random()*#maps] --This is the change I've made. wait() if pickedMap.ID.Value == game.Workspace.LastMap.Value then print("Choosing another map..") wait() else print("Map chosen!") choose = false end end game.Workspace.LastMap.Value = pickedMap.ID.Value local pickedMapClone = pickedMap:clone() pickedMapClone.Parent = game.Workspace pickedMapClone:makeJoints() script.Parent.ready.Value = true script.Disabled = true |
|
|
| Report Abuse |
|
|