So this is my attempt at using JSON ((Literally just wrote it here.)) I'm attempting to make a way to save data, but as you can tell, I do not have a very good grasp on how it works. So If someone could explain it or maybe correct how I did it, I'd be super Thankful.
PS do I use datastore in this too? if so, how? Thanks.
local Http = game:GetService("HttpService")
game.Players.PlayerAdded:connect(function(P)
local F = Instance.new("Folder",P)
F.Name = "Folder"
local CS = {
Money = P.Folder.Value,
Level = P.Folder.Value
}
for i=1,CS do
local M = Instance.new("IntValue",F)
M.Name = CS--How do I go about putting the name of the values from CS?
M.Value = CS--How do I go about putting the value of the named strings from CS?
end
end)
game.Players.PlayerRemoving:connect(function(P)
local CS = {
Money = P.Folder.Value,
Level = P.Folder.Value
}
local JSON = Http:Jsonencode(CS)
end)
