local randomPartsFolder = game.Workspace.ItemSpawns:GetChildren()
local RandomObjects = game.ServerStorage.Items:GetChildren()
wait(5)
local function randomSpawn()
local pos = randomPartsFolder[math.random(2, #randomPartsFolder)]
local randomClones = RandomObjects[math.random(2, #RandomObjects)] -- This is the
one I need help with. It only spawns one item
randomClones.Position = pos.Position
randomClones.Parent = workspace
print(randomClones.Name)
end
randomSpawn()
Yeah, it only spawns one thing out of the 4 things in the folder.
I think they use the same generator, the Random object just has prettier syntax. Edit: You can have multiple Random objects while you can only ever use math.random. They’re fairly different, but the actual numbers themselves aren’t more reliable.
math.random and the Random API use the same algorithm but I think it may be more than just pretty syntax? Random is an object with methods based around it, while math.random is a function and any modifiers are independent of it (such as using math.randomseed).
math.randomseed(tick()) -- Change seed relative to environment
math.random()
-- vs
Random.new(tick()) -- Change seed relative to object
Random:Next[Number/Integer] -- Get a direct number, no after-math (pun unintended)
For sure. I don’t know what “numeric reliability” is between Random and math.random. That’s unimportant, it’s a random number generator. There is no such thing as reliability between either method. Me personally though, I prefer Random mainly because
A. I don’t want to do extra math; I just want my number as in when I call it.
B. Seed relativity.
C. Branching.