-
What do you want to achieve? Keep it simple and clear!
I want to make a script that prints an available roblox username -
What is the issue? Include screenshots / videos if possible!
The output prints as nil
Script
local HttpService = game:GetService("HttpService")
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', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '_'}
local RandomNumber = math.random(1,#tablething)
local Letter = tablething[RandomNumber]
local RandomNumber = math.random(1,#tablething)
local Letter1 = tablething[RandomNumber]
local RandomNumber = math.random(1,#tablething)
local Letter2 = tablething[RandomNumber]
local RandomNumber = math.random(1,#tablething)
local Letter3 = tablething[RandomNumber]
local RandomNumber = math.random(1,#tablething)
local Letter4 = tablething[RandomNumber]
local Combined = Letter..Letter1..Letter2..Letter3..Letter4
local URL_ISS = "https://auth.roblox.com/v1/usernames?username="
local test = Combined
URL_ISS = URL_ISS..HttpService:UrlEncode(test)
print(URL_ISS)
local decodedthing
local data
pcall(function()
data = HttpService:GetAsync(URL_ISS)
print(data)
decodedthing = HttpService:JSONEncode(data)
print(decodedthing)
end)
print(decodedthing)
Expected Output
https://auth.roblox.com/v1/usernames?username=jFLsF
"{\"usernames"\:\["jFLsF"]\}" --Or something like that
The output that i am getting
https://auth.roblox.com/v1/usernames?username=jFLsF
nil
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried to decode and encode it and the developer hub doesn’t really help much
So yeah any help will be appreciated and sorry i am just new to HttpService