Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

math.random finds the same set of values every time?

Asked by
pwnd64 106
8 years ago

Hi, I'm trying to make a script that will choose a random gamemode. It gives me the same set of gamemodes every time,however.

Minigames = {"Team Death Match", "Capture The Orb", "Attack" ,"Up and Over", "Kart Race"} --where the minigames are

DecidedMinigame = script.DecidedMiniGame

function DecideRound()

    DecidedMinigame.Value = Minigames[math.random(1, #Minigames)]

end

DecideRound()

print (DecidedMinigame.Value)

DecideRound()

print (DecidedMinigame.Value)

DecideRound()

print (DecidedMinigame.Value)

DecideRound()

print (DecidedMinigame.Value)

DecideRound()

print (DecidedMinigame.Value)

Thanks

Answer this question