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

can datastore data be viewed?

Asked by 6 years ago
Edited 6 years ago

I've recently created a Data saving script for playerdata in my game. The system looks like this:

local function SaveData(player)
    if player.userId < 0 then return end
    player:WaitForChild("leaderstats")
    wait()
    local leaderstats = {}
    for i, stat in pairs(player.leaderstats:GetChildren()) do
        table.insert(leaderstats, {stat.Name, stat.Value})
    end
    leaderboardData:SetAsync(player.userId, leaderstats)
    Print("Saved "..player.Name.."'s data")
end

local function LoadData(player)
    if player.userId < 0 then return end
    player:WaitForChild("leaderstats")
    wait()
    local leaderboardStats = leaderboardData:GetAsync(player.userId)
    for i, stat in pairs(leaderboardStats) do
        local currentStat = player.leaderstats:FindFirstChild(stat[1])
        if not currentStat then return end
        currentStat.Value = stat[2]
    end
    Print("Loaded "..player.Name.."'s data")
end

Now it works perfectly, but I have found that I cannot view the data it has saved.

By this I mean the data loads and you can see it in-game, but I cannot see what the datastore service holds for each player in the studio. If I saw a player and wanted to change one of their statistics, I don't know where I would go to do that. Does anyone know where I can see the datastore service's contents?

this will be appreciated

1 answer

Log in to vote
0
Answered by 6 years ago

First of all, please codeblock your code using the blue Lua button then put your code within the squiggly lines.

The answer to your question is no, at least not the way you think. Roblox does not allow us to see the entire contents because they don't have a spot available for everyone to view. To view data, you need to make it yourself. You would need to use GetAsync and make code to sort the data to be readable for you and to edit data, you'd have to make code to do so yourself and then save it. I am unsure if you can view the same data in game as you can in studio, as in I don't know if the same data is shared.

Here are some other methods you could do to view and edit player data, although they are more advance.

Create your own website and save data on it, this way you have the ultimate control on all data saved and can view it, of course half of this requires different coding languages than lua.

A second method is using google spreadsheets (I believe this website) which is a little more easier because you should only need Lua and the http service.

0
Thank you, and do you know anywhere that I could find a way to do this? I've been searching for things just like this and guess what? No results. Just the ROBLOX Datastore page over. and over. and over. DANISSY1 2 — 6y
0
You shouldn't be using Google Spreadsheets for this. Avigant 2374 — 6y
0
If you disagree then you should elaborate on why. He asked for a way to view data so I gave him ways. alphawolvess 1784 — 6y
0
http://wiki.roblox.com/index.php?title=Data_store Try this link, it should be a manual. For info on spreadsheets, I believe there is a tutorial in devforum just search spreadsheet. alphawolvess 1784 — 6y
Ad

Answer this question