I would like the image to be placed randomly across the screen but keep it relative to the players window so even if they resized it it would fill from the left border to the right border, but by doing (0,1) it only places on either the right side or left side. So i was wondering if anyone had a solution for this
local t = tick() for i = 1, 5 do local bubble = Instance.new("ImageLabel") bubble.Name = "bubble" bubble.Position = UDim2.new(math.random(0, 1), 0, 0, 0) bubble.Size = UDim2.new(0, 100, 0, 100) bubble.Parent = Player.PlayerGui.Loading.Frame bubble.Visible = true end
edit: this is the line im talking about
bubble.Position = UDim2.new(math.random(0, 1), 0, 0, 0)
I can't exactly do what your asking for but this might be a solution that you want
local t = tick() for i = 1, 5 do local bubble = Instance.new("ImageLabel") bubble.Name = "bubble" bubble.Position = UDim2.new(math.random(1, 100) / 100, 0, 0, 0)--we get a random number 1 to 100 and divide it bubble.Size = UDim2.new(0, 100, 0, 100) bubble.Parent = Player.PlayerGui.Loading.Frame bubble.Visible = true end