Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can I generate a random word?

1 answer

✓ Accepted answer

nvm, This works:

local HttpService = game:GetService("HttpService")

local function randomword()

local response = HttpService:RequestAsync(

{

Url = "http://watchout4snakes.com/wo4snakes/Random/RandomWord", -- This website helps debug HTTP requests

Method = "POST",

Headers = {

["Content-Type"] = "application/json"

},

Body = HttpService:JSONEncode({hello = "world"})

}

)

-- Inspect the response table

if response.Success then

return(response.Body)

else

print("The request failed:", response.StatusCode, response.StatusMessage)

end

end

local success, message = pcall(randomword)

if not success then

print("Http Request failed:", message)

end


  

print(randomword())

This discussion is preserved as it was. New answers, comments, and votes are closed.