Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to Obtain a List from a Text Document?

Asked by 6 years ago

Can somebody tell me how I would make a Pastebin document into a list? (The document itself is a list.)

0
post link of it hellmatic 1523 — 6y

1 answer

Log in to vote
3
Answered by
Amiaa16 3227 Moderation Voter Community Moderator
6 years ago

Make the document JSON formatted. Then use HttpService:GetAsync() to fetch it, and then use HttpService:JSONDecode() to turn it into a table

local url = "http://pastebin.com/raw/blablabla"

local hs = game:GetService("HttpService")
local document = hs:GetAsync(url, true)
local json = hs:JSONDecode(document)
--do stuff
Ad

Answer this question