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

I cant access my own save data ( like string values stuff ) Why?

Asked by 5 years ago
local dss = game:GetService("DataStoreService")
local data = dss:GetDataStore("PlayerData")

local serverData = {}
local templatePlayerData = {String = "string", Number = 0, Table = {}}

game.Players.PlayerAdded:connect(function(plr)
    serverData[plr] = data:GetAsync(plr.UserId) or templatePlayerData
    table.insert(serverData[plr].Table,"Hello")

    local data = Instance.new("Folder", plr)
    data.Name = "Data"

    local num = Instance.new("StringValue", data)
    num.Value = serverData[plr].Table.String.Number -- problem occurs here
end)
game.Players.PlayerRemoving:connect(function(plr)
    data:SetAsync(plr.UserId,serverData[plr])
    serverData[plr] = nil
end)

I really am bad with data stuff, but can someone help me on how to convert the data "Hello" to a string value , since this system is in a table so i cant really configure it from other scripts... or thats what i think.

0
sorry if u guys dont get it, its hard to put it in words.. xXKillerMurderarXx 59 — 5y

Answer this question