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

Websites for storing data and retrieving it with GetAsync?

Asked by 8 years ago

So I'm trying to make a game where I'll be using several places that connect to each other. The only efficient way to store global settings in this scenario would be to keep it on the web, and retrieve it using GetAsync with HttpService.

One problem:

I have no idea what trustworthy websites are capable of doing this. I really don't want to use pastebin, because I've heard from other people it's relatively slower than alternative options, and not very trustworthy. Here would be an example of my code:

local Http = game:GetService("HttpService")
local Database = "www.WhatWebsite?.com/Key"

local Settings = Http:GetAsync(Database)
print(Settings) -- Whatever I have stored 

Second problem:

The data I'd be storing on the website would be an Lua table (in a string, of course), which brings me to my next problem: How would I convert the string table that I got with HttpService, into an Lua table?

Since the settings are inside the table I'd be getting from the website, I'd need some way to decode the string into a table (instead of the string of text it returns).

Is there a way to convert the string of text it returns back into an Lua table? If any of this possible, and you have some insight about it, I'd really appreciate it. This has been driving me crazy.

1 answer

Log in to vote
2
Answered by
DataStore 530 Moderation Voter
8 years ago

In regards to your first hurdle I can't really provide much insight, though I would push you to go the Pastebin route - It's free and it's easy, especially if you're just looking for somewhere to throw a bunch of settings that you can edit on a whim.

I just don't see how Pastebin can be classed as "untrustworthy".

Another route you could go is with LinkedSource. ROBLOX recently overhauled it, and I'm sure that with some wiggling you could use it how you want it; though, this route only allows editing through studio - Meaning that, if you wanted the game to save something you wouldn't be able to do it.


With your second issue, assuming it's JSON encoded, just use HttpService's JSONDecode method.

0
LinkedSource will work just fine. Thank you very much! CodingEvolution 490 — 8y
Ad

Answer this question