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 7 years ago

Posted again because nobody answered in 7 hours. 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 datastore data persistence is depreacted MRNinjaCreator 95 — 7y
0
that does not help with saving the droppers sesamert16 31 — 7y
0
Make a datastore for values and have them update when the player makes a purchase such as a boolean BunnyFilms1 297 — 7y
0
Use a code block please. User#14829 0 — 7y

1 answer

Log in to vote
0
Answered by
H4X0MSYT 536 Moderation Voter
7 years ago

First of all, I would like to say actually try to make it save. I can tell you didn't make that script, and it is a free model. "I tried this script". If you really tried, you would be able to see that it saves leaderstats. Non attempt. Heres what you do: Create a value for every single item purchaseable, and save that in a datastore, and use that to load and save data. Oh and by the way, you will actually need to learn to script for that. Tycoon kits don't accommodate for that.

0
I'll try it, but being mean doesn't help anyone sesamert16 31 — 7y
Ad

Answer this question