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

Saving data with HttpService?

Asked by
RedCombee 585 Moderation Voter
10 years ago

I've never tried HttpService before, but someone suggested that I use it to save table values (Better explained in my previous question). I don't know where to start with saving by using this method, even after looking over the wiki page a couple times. Help?

1 answer

Log in to vote
0
Answered by 10 years ago

You shouldn't be using HttpService for something like this. Instead, use DataStores. To save a table value with HttpService, simply do something like

datastore:UpdateAsync("Example",function(old) -- make sure it's a table
    if type(old)~="table" then
        return {}
    end
    return old
end)

From then on, you can do:

datastore:UpdateAsync("Example",function(old)
    old[whatever]=whatever2
    return old
end)

Remember to almost never use SetAsync unless the data saved before does not matter.

0
Can you explain this in greater detail, please? RedCombee 585 — 10y
Ad

Answer this question