Fix math.random returning same value

i coded a module which fixs this issue.

using this module fixs math.random!

return function (number1,number2)
	local gu = game:GetService("HttpService"):GenerateGUID(false)
	local n = ""
	for i,v in ipairs(string.split(gu,"")) do
		if tonumber(v) then
			n = n .. v
		end
	end
	n = tonumber(n)
	
	while n > 10000000 do
		n /= 1.5
	end
	
	math.randomseed(n)
	local res = math.random(number1,number2)
	return res
end

image
happy scripting!

1 Like

I mean… you could just skip all of this and use the Random object instead, where seeds aren’t shared between Random objects. The simplicity of random from the math standard library is one thing but you may not want to miss out on the extensibility of Random.

3 Likes