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

Httpservice random.org api help?

I have no idea how to return the table of functions for the random.org api. Can anyone help?

1 answer

You could have read the page, it's well documented.

Basically you set the url like http://www.random.org/integers/?min=1&max=100&num=25&base=10&format=plain&rnd=new&col=1

All parameters are self explanatory. So

function getRandom(mi, ma, n)
	local http = game:GetService("HttpService")
	return http:GetAsync(("http://www.random.org/integers/?min=%d&max=%d&num=%d&base=10&format=plain&rnd=new&col=1"):format(mi,ma,n))
end

Where mi is the minimun number, ma is the maximun number, and n is the amount of numbers to generete, you will need need to parse the result string, but that's easily done with patterns. Make sure HTTPservice is enabled

2 comments

0

No, I meant return the api as a table

0

Um... What? You can't do that. The API just specifies how to send requests. You need to write your implementation. It's not going to return you a table of Lua functions to manipulate it.

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