Im trying to save a table through a datastore. It prints out table:21fn4ruwfnwfmwe or something like that, so when I added JSONEncode, it printed out [“word”, “data”]. How do I now find the first parameter in the table (which is word).
da[1] doesn’t do it!
local DataStoreService = game:GetService("DataStoreService")
local appStore = DataStoreService:GetDataStore("App")
local app = {"word", "data"}
local http = game:GetService("HttpService")
game.Players.PlayerAdded:Connect(function(player)
local success, err = pcall(function()
appStore:SetAsync(player.UserId, app)
local da = appStore:GetAsync(player.UserId)
da = http:JSONEncode(da)
print(da[1])
end)
if success then
print("Success!")
else
print(err)
end
end)