Why is my math.Random getting the same value each time?

I’m making an pop up gui and the math.random is getting the same value each time. Heres my script

script.Parent.Changed:Connect(function(Value)
	local Text = script.Parent.Parent
	local Frame = script.Parent.Parent.Parent
	Frame.Position = UDim2.new(0.357, 0, 0.613, 0)
	Text.TextTransparency = 0
	Frame.Visible = true
	local RandomPosY = math.random(0.313, 0.563)
	local RandomPosX = math.random(0.257, 0.757)
	Frame.Position = UDim2.new(RandomPosX, 0, RandomPosY, 0)
	script.Parent.Parent.Text = "+"..Value
	Frame:TweenPosition(
		UDim2.new(Frame.Position.X, Frame.Position.Y + UDim.new(-0.2, 0)),
		"Out",
		"Linear",
		0.4
	)
	wait(0.3)
	for i = 0, 1, 0.1 do
		wait(0.01)
		Text.TextTransparency = i
	end
	Frame.Visible = false
end)

So the frame is basically popping up in the left top corner each time

I believe you’re talking about:

	local RandomPosY = math.random(0.313, 0.563)
	local RandomPosX = math.random(0.257, 0.757)

math.random unfortunately won’t work as intended here and if I’m correct will probably give you 0 each time. You could try doing the following instead:

local RandomPosY = math.random(313, 563) / 1000
local RandomPosX = math.random(257, 757) / 1000

print(RandomPosX, RandomPosY) ---> wont print 0 for everything, that's for sure.

not an integer value, divide it.

local randomObject = Random.new(tick())
local randomNumber = randomObject:NextNumber(0.25, 0.75)
print(randomNumber)