I am making a simple minigame test, for a friend, and I made this code:
local status = game.StarterGui.Status.StatusLabel
local reward = 10
status.Text = "NEED MORE PLAYERS FOR MINIGAME"
until game.Players.NumPlayers >= 1
if game.Players.NumPlayers >= 1 then
status.Text = "MINIGAME STARTING SOON"
status.Text = "OBJECTS LOADING"
local objects = game:GetService("ServerStorage").Objects:GetChildren()
local clonedObject = objects[(math.random(1,#objects))]:Clone()
clonedObject.Parent = workspace
status.Text = "OBJECTS HAVE BEEN LOADED"
The status won’t change, even when the objects have been cloned.
The algorithm used by Random is the XSH-RR variant of the PCG family.
In a nutshell, it’s is a fast algorithm with excellent statistical properties.
We’re planning to change math.random to use the same algorithm by early next year.
I believe this post was made in 2017. It has been 3 year since then, and that change has likely been implemented.
The only reason you might want to use the Random class is for an object oriented approach, or a case where you might need several “random” generators with different seeds.