Hi! I’ll walk you through what I personally would do.
First, take advantage of ROBLOX’s free data storage, and use their Datastore Service.
After I set up a valid way for Datastore to work both upon joining & leaving, I would…
Set a dictionary up, add players to it and store all their data stored within it, then make external values to store those values in another table upon leaving, then store those in the new table. it would most likely look something like this:
local DatastoreService = game:GetService("DatastoreService");
local PlayerDatastore = DatastoreService:GetDatastore("Players");
local Players_Data = {}; --[[These would take indexes of players UserId, then would
have the actual data tied to them via a dictionary]]--
local Ingame_Data = {}; --[[This'll update every now and then,
make sure this updates every now and then, or upon them clicking save? idk,
I'm actually trying to explore new options rn so let me know if this idea is bad.
]]--
game.Players.PlayerRemoving:Connect(function(Player)
local Current_Data = GetCurrentData(Player.UserId); --[[ this is just a fetch function, pulling the index by their id and what not, not writing all of this, just for reference, but to give an idea, you'd be pulling from the Ingame_Data table since that'd be the values you're trying to replicate and save, and then vise versa for replicating back into the game.]]--
local Data_Table = { Level = Current_Data.Level, Skin = Current_Data.Skin} -- And whichever values you really need... }
};
local Success, Error = pcall(function()
PlayerDatastore:SetAsync(Player.UserId, Data_Table)
end)
end)
I think you get what I’m trying to do, this just serves as a small example, I’ll leave the rest to you, but this is primarily how I’d handle it. I hope I helped!
It was more of an example of how to make something like this, not a hand-me-over copy of the code. You’re going to have to program it yourself, unfortunately. The devforum serves as a place to learn off each other, and just give copies of each others homework in an analogical sense, if you get what I mean.
Well, first you should undergo a proper way to learn how to program, whether you want to self teach yourself or not, it’s entirely up to you!
Find people that can teach, watch youtube videos, the devforum is always here to help, and most importantly, ROBLOX has their own place for learning how to program, it’s their API reference, check it out.