I stole @imKirda’s script, modified it a little, and made this:
local StarterGui = game:GetService("StarterGui")
local screenGui: ScreenGui = Instance.new("ScreenGui")
screenGui.IgnoreGuiInset = true
screenGui.ResetOnSpawn = false
screenGui.Name = "Root"
local backgroundFrame: Frame = Instance.new("Frame", screenGui)
backgroundFrame.BackgroundColor3 = Color3.new(0.5, 0.5, 1)
backgroundFrame.BorderSizePixel = 0
backgroundFrame.Size = UDim2.fromScale(1, 1)
backgroundFrame.Name = "Background"
local function RandomedNumberWithSeed(Seed, RandomMin, RandomMax)
math.randomseed(Seed)
return math.random(RandomMin, RandomMax)
end
local function drawLine(from: Vector2, to: Vector2): Frame
local line: Frame = Instance.new("Frame")
line.BackgroundColor3 = Color3.new(0, 0, 0)
line.BorderSizePixel = 0
line.AnchorPoint = Vector2.one / 2
line.Position = UDim2.fromOffset((from.X + to.X) / 2, (from.Y + to.Y) / 2 + 64)
line.Rotation = math.deg(math.atan2(to.Y - from.Y, to.X - from.X))
line.Size = UDim2.fromOffset(math.sqrt((from.X - to.X) ^ 2 + (from.Y - to.Y) ^ 2), 2)
line.Name = "Line"
return line
end
local previousPosition: Vector2
for index: number = 1, 4000 do
local frame: Frame = Instance.new("Frame", backgroundFrame)
frame.BackgroundTransparency = 0
frame.BackgroundColor3 = Color3.new(0, 0, 0)
frame.BorderSizePixel = 0
frame.AnchorPoint = Vector2.yAxis
frame.Position = UDim2.new(0, index * 0.25, 0.5, -RandomedNumberWithSeed(math.huge, 1, index))
frame.Size = UDim2.fromOffset(4, 4)
frame.Name = tostring(index)
local frameCorner: UICorner = Instance.new("UICorner", frame)
frameCorner.CornerRadius = UDim.new(0.5, 0)
--if previousPosition then
-- local line: Frame = drawLine(previousPosition, frame.AbsolutePosition)
-- line.Parent = backgroundFrame
--end
-- If I did draw lines for the dots my computer would explode because you would need 5999 frames
-- And it's so unnecessary because the precision of the frame is so tight
previousPosition = frame.AbsolutePosition
end
screenGui.Parent = StarterGui
You do not need to understand the full script, but this is a chart of different second parameter of the function math.random
(I explained this part poorly, sorry). If you want to use the script, put it in ServerScriptService
as a Script
and paste in the code in. This is what it will look like after you do all the steps and run the code:
The results are pretty linear, so I tried to make a formula for it, basically, to calculate how you would get the “weird number 7” in the math.random(1, 100)
function, you would do need to use this formula:
math.round((randomparameter2 - randomparameter1) / 15)
Doesn’t work 100% of the time, but it works pretty well
math.round((100 - 1) / 15)
equals to 7
math.randomseed(math.huge)
would make the function math.random(1, 100)
equals to 7, see the connection?
math.round((600 - 1) / 15)
equals to 40
math.randomseed(math.huge)
would make the function math.random(1, 600)
equals to 41, although it’s not the equaled value to the math.round((600 - 1) / 15)
as I mentioned above, it’s pretty near
Don’t know how would this add to the conversation, but maybe this would give other people some clues of what is the algorithm, or is it an engine bug?
Look like I have overcomplicated so many things, please don’t complain (6/5/2022)