What I'm doing is that I'm using GetAsync() to retrieve a list of userIds from a "paste" I've created on Pastebin. I'm then splitting the userIds into seperate entries into an array.
It appears that it runs perfectly fine about 60% of the time, but however, it just returns a bunch of nil values the other 40% of the time. It appears to be random which happens every time.
Output when it functions properly | Output when it returns nil a bunch of times
Code:
winners = {}
link = "PASTEBIN LINK" -- I have the link to my paste here. The paste is comprised of raw text.
pcall(function() -- try/catch (don't error out)
text = game:GetService("HttpService"):GetAsync(link, true)
end)
if string.len(text) > 0 then
for playerId in string.gmatch(text, "[^\n]+") do -- Split the document into an array containing the strings delimited by all newline characters
table.insert(winners, tonumber(playerId))
print(tonumber(playerId))
end
end
The list contains some userIds separated by newline (with no blank lines or any spaces in between).
Also I'm running this in a regular game server. It doesn't seem to have any trouble when I do it in Test mode in Studio.
Is there a fault in the code I've written? Could it be an issue on Pastebin's side? Any insight would be appreciated. Thanks!

1 comment
It turns out that Github caches raw text for a few minutes once you push a new commit so changes won't be reflected instantly in-game since the raw data has to wait to be updated. For requests to be made on occassion over time (like in my scenario) this is fine, but if you're trying to create real-time leaderboards or something, you're probably better off using your own website to store the data.