I am trying to make a tryout game but I want the username of players to be randomly generated letters, this is what I have so fair but would like feedback on it
length = 7
charset = {
"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","1","2","3","4","5","6","7","8","9","0"
}
if length < 0 then
warn("You can only generate usernames with a minimum of 5 characters right now to prevent abuse!")
else
found = false
local httpservice = game:GetService("HttpService")
while found == false do
gen = charset[math.random(1,#charset)]
for i = 1, length - 1 do
gen = gen .. charset[math.random(1,#charset)]
end
print("Checking if name ''" .. gen .. "'' is taken via a proxy...")
result = httpservice:GetAsync("https://rprxy.xyz/UserCheck/DoesUsernameExist?username=" .. gen, true)
if result == '{"success":false}' then
untaken = gen
found = true
else
print("Username already taken! Name: " .. gen)
end
end
print("------------------------------------------------------------")
print("UNTAKEN USERNAME ALERT!")
warn("Username:")
print(untaken)
print("------------------------------------------------------------")
end```