So I have been looking at the tutorials on the wiki but I cannot seem to understand how to use JSON. I have this based off of the tutorials:
game.Players.PlayerRemoving:connect(function(playerL)
if playerL:WaitForDataReady() then
local xp = playerL.xp
local kills = playerL.kills
local deaths = playerL.deaths
local cash = playerL.cash
local data = {
xp = playerL.xp,
kills = playerL.kills,
deaths = playerL.deaths
cash = playerL.cash,
name = playerL.userID
}
local RbxUtility = LoadLibrary("RbxUtility")
player:SaveString('data', RbxUtility.EncodeJSON(data))
end
end
end)
I am not exactly sure if it works because I have not been able to test it yet (haven't gotten to it), but assuming this works, how would I decode, because if I am correct JSON decodes into a table, but how would I pick out the info from the table? This is what I have but it is incomplete:
game.Players.PlayerAdded:connect(function(player)
if player:WaitForDataReady() then
local RbxUtility = LoadLibrary("RbxUtility")
player:LoadString('data', RbxUtility.DecodeJSON(data))
player.xp = xp
end
end
end)
EDIT: The reason I am using JSON is because I don't want to have to worry about the Data Limit later on as much. Is this a valid reason, like should I be worried or should I use a different way?
EDIT (again): I looked over this again, and did some more research and I still don't really understand.

3 comments
First time writing a full fledged answer. Please love me.
Lol and thanks but I decided, after MOAR RESEARCH, to use Data Stores. xD but thank you for the answer, I learned stuff :D, hopefully someone will come here and find it helpful.
Patch can you upvote if it helped thanks :D