In the meantime, you can add these functions to your game – probably in a utilities module of some sort:
local function MultiNextInteger(rng, a, b, count)
local t = {}
for i = 1, (count or 1) do
t[i] = rng:NextInteger(a, b)
end
return unpack(t)
end
local function MultiNextNumber(rng, a, b, count)
local t = {}
for i = 1, (count or 1) do
t[i] = rng:NextNumber(a, b)
end
return unpack(t)
end
local vec = Vector3.new(MultiNextNumber(rng, -100, 100, 3))
Here’s another fun one:
local function ManyNextInteger(rng, ...)
local t = {}
local count = select('#', ...)
for i = 2, count, 2 do
t[i/2] = rng:NextInteger(select(i - 1, ...))
end
return unpack(t)
end
local function ManyNextNumber(rng, ...)
local t = {}
local count = select('#', ...)
for i = 2, count, 2 do
t[i/2] = rng:NextNumber(select(i - 1, ...))
end
return unpack(t)
end
local vec = Vector3.new(ManyNextNumber(rng, -100,100, -50,50, -100,100))