Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Saving Work from a Different Place?

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

1 answer

✓ Accepted answer

Use DataStores.

DataStores are specific to each game, and all the places the game may house.

4 comments

0

Will the Data I have right now still be saved using DataStores?

0

Looks like the free model you found is using Data Persistence, a deprecated service.

0

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?

0

ask another question

This discussion is preserved as it was. New answers, comments, and votes are closed.