Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Autosave droppers in tycoon?

Asked by 6 years ago

I am building a very long tycoon where you build a store chain with over 10 locations. Saving has become an issue because players spend hours playing the game and want to continue where they left off next time they play but they can't. I tried this script: 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) but it only saves the leaderstats, not the droppers like I want it to. Any suggestions?

0
Use DataStores instead of Data Persistence mattscy 3725 — 6y
0
Again, that makes it only save the leaderstats and not the droppers. sesamert16 31 — 6y
0
Ok it's been 7 hours, why hasn't anyone answered? sesamert16 31 — 6y

Answer this question