I’ve been having a problem with trying to get rid of repeating values, I tried stopping the problem by checking other the other TextLabels in the Gui for the same value, but that still didn’t work. I’d like to see some feedback to help fix this issue.
function RandomFunction()
local Value = Table[math.random(#Table)]
for _,Child in pairs(script.Parent:GetDescendants()) do
if Child.Text == Value then
repeat Value = Table[math.random(#Table)] until Child.Text ~= Value
end
end
return Value
end
math.random is annoying because what is really random doesn’t feel very random. Apple had a similar issue as far as I know where users complained about randomly shuffed songlists being too orderly.
Anyway I have a feeling that using math.random without any arguments (which gives you a random real number) and then converting the numbers to a different Range would give a better result.
I won’t guarantee anything though, might be just as bad
function RandomNumber(Min,Max)
local Spread = Max - Min
local RandomReal = math.random()
local Offset = RandomReal * Spread
local Unrounded = Min + Offset
local DecimalPart = Unrounded - math.floor(Unrounded)
if DecimalPart > 0.5 then
return math.ceil(Unrounded)
else
return math.floor(Unrounded)
end
end
That is raw random, you can get stuff like 3 3 3 3 3 2 4 3 5 6 2 in rare cases… What you can do is check to see if 3 was previously stated then change it to something else…
randomseed is basically, whenever you join a game and spin a random generator, you will get random numbers but EVERYTIME you join you get those same random numbers
There are weighted randomizers that use percentage like in adopt me when you are getting an egg, “.002%” chance…
Yay, I tried using a randomizer which returns different values more repeatedly than others. It seems to work good, in my script I just did a work around where if does repeat itself it won’t mess up completely.