Switching Guis Positions Using TweenService

So I need to switch these ImageLabels called “keys” positions and I want none to overlap, but my code isn’t working

local Positions = {
    UDim2.new({0.639, 0},{0.787, 0}),
    UDim2.new({0.33, 0},{0.462, 0}),
    UDim2.new({0.33, 0},{0.3, 0}),
    UDim2.new({0.33, 0},{0.787, 0}),
    UDim2.new({0.639, 0},{0.462, 0}),
    UDim2.new({0.639, 0},{0.3, 0}),
    UDim2.new({0.639, 0},{0.625, 0}),
    UDim2.new({0.33, 0},{0.625, 0})
}

function findpos(key)
    local chosenPosition = Positions[math.random(1, #Positions)]

    game:GetService("TweenService"):Create(key, TweenInfo.new(0.5), {Position = chosenPosition}):Play()
end

game.ReplicatedStorage:WaitForChild("Events"):WaitForChild("Captcha").OnClientEvent:Connect(function()
    script.Captcha.Captchas.Limbo.Visible = true
    -- task.wait(1)
    
    for i = 1,10 do
        task.wait(0.5)
        for i,v in pairs(script.Captcha.Captchas.Limbo.keys:GetChildren()) do
            findpos(v)
        end
    end
end)

When the event fires, all the keys go to the same position

You need to remove the squirly brackets {} for your script to work.

I did this and now they move, but still overlap. How can I fix this?
I need it so that none of the keys will ever end up on a position thats already occupied by another key.

Well, you could remove an already occupied position from the table with table.remove so that it can’t be picked.
Then, when the position is not occupied anymore, reinsert the position with table.insert.

Make sure for the size it uses only scale, as it may overlap depending on screen size if you use pixels. (Scale are the first and 3rd numbers in a Udim2, the first represents the scale of the X and the third represents the scale of the Y)