local parts = {
    1,
    2,
    3,
    4,
    5,
    6
}
local ran = math.random(1,6)

for i, v in pairs(parts) do
    repeat
    if parts[i] == parts[ran] then
        print("no")
    end
    until parts[i] == parts[ran]
end

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: