Hello everyone. I am working on a script, and I have this game that has Saved Data, I want it to be able to be saved at other places as well, not the place that it is in. The script will explain.
--Made 100% by Resplendid
--For LukeGabriel
game.Players.PlayerRemoving:connect(function(p)
if p:findFirstChild("leaderstats") then
p:SaveInstance("SavedStatPNum"..tostring(game.PlaceId),p.leaderstats)
end
end)
game.Players.PlayerAdded:connect(function(p)
for k = 1, 60, 0.03 do
wait()
if p:findFirstChild("leaderstats") and p.DataReady then break end
end
local Loaded = nil
if p:findFirstChild("leaderstats") and pcall(function() Loaded = p:LoadInstance("SavedStatPNum"..tostring(game.PlaceId)) end) then
for j, v in pairs(Loaded:GetChildren()) do
pcall(function() p.leaderstats[v.Name].Value = v.Value end)
end
end
end)
I want the PlaceId to be the "Lobby" Game, not the game that a player is in. Any clues?
Thanks, LukeGabrieI

4 comments
Will the Data I have right now still be saved using DataStores?
Looks like the free model you found is using Data Persistence, a deprecated service.
Thanks, I found another script for it to work. Do you know how to create a Global Leaderboard? I would like to put this leaderboard in game, like it would say Top 10 Players Highly Ranked. I'm looking for some Global Leaderboards, but they seem to not work. Any help?
ask another question