Hello there i made a code that generates roblox usernames but im here to ask on how else can i improve the script?
local tablething = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}
local Letters = {}
local Combined = ""
local UserId
for i=1,6 do
table.insert(Letters,#Letters,tablething[math.random(1,#tablething)])
end
for i,v in pairs(Letters) do
Combined = Combined..v
end
local success,errormessage = pcall(function()
UserId = game.Players:GetUserIdFromNameAsync(Combined)
end)
if success then
print(Combined.." Already exists. UserId: "..UserId)
else
print(Combined.." Is not taken")
end