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