How would I get a random noun word?

Yes, I know I could use HttpService, but I can’t find any apis
Is there any way to get a random noun word?

I’m doing this to make a endless quiz game.

Any scripts will help!

You could use an insanely long table with random words, or find an API (don’t know any APIs aswell to be honest)

Example:

local getNouns = {"IS", "THAT", "THE", "BITE", "OF", "87???"} --fnaf moment :cold_sweat:

print(getNouns[math.random(#getNouns)])
1 Like

I did find a api that generates random words, but sometimes it might not be a noun.

Well that’s a problem, you could try a pastebin with randomized words like this.

Then you could get all of the words inside and randomize to avoid extremely long tables, but I forgot how to do it. I remember a forum post that dealt with getting values from a pastebin, can’t find it though sadly.

I found this API: https://random-word-form.herokuapp.com/ – particularly this one: https://random-word-form.herokuapp.com/random/noun.

Source here: GitHub - dulldesk/words-api: API to randomly generate an adjective, a noun, or an animal

There’s also this which I found by looking around the source: http://www.desiquintans.com/downloads/nounlist/nounlist.txt

This may help.

local HttpService = game:GetService("HttpService")

local function GenerateWord(C,len)
	local url = "https://random-word-api.herokuapp.com/all"
	local response = HttpService:GetAsync(url)
	local decoded = HttpService:JSONDecode(response)
	local totalwords = {}
	local gottenwords = 0
	for i,v in pairs(decoded) do
		local w = decoded[math.random(1,#decoded)]
		if string.len(w) <= C then
			gottenwords += 1
			table.insert(totalwords,w)
		end
		if gottenwords == len then
			break
		end
	end
	return totalwords
end

local Words = {}

function Words:GenWords(Complexity,Length)
return GenerateWord(Complexity,Length)
end

return Words

just made it a bit more coddy

1 Like