Is there another way to save game data than leaderstats type of thing

I’m trying to make a saving tycoon and I am just wandering if there was a way to save the tycoon without creating a hundred values under a “leaderstats” type of thing.

I have asked some smaller developers but they have not replied in weeks. Any help would be greatly appreciated. :smile:

its not leaderstat that stores but the datastore
can try this:

or

I think you could save a Table of their completed ‘Buttons’ or where they’re up to. Or, you could use a leveling system (Not like a leaderstats, more like a system only used by the game itself). So say, if I’m on Level 78 (unseen by me, only seen by the game), I’ll have access of the tycoon up to a certain button

Good point :smile: thanks for that, I completely forgot

1 Like

How could I save a table, because I have only ever worked with IntValues or StringValues under a data store

Pretty simple, it’s kinda the exact same way

local PlayerStats = {
Level = Player.leaderstats.Level.Value;
Coins = Player.leaderstats.Coins.Value;
}
SomeDataStore:SetAsync(Player.UserId.."-stats", PlayerStats)

-- Retrieving Data
game.Players.PlayerAdded:Connect(function(Player)
local Stats = Instance.new("Folder", Player)
Stats.Name = "leaderstats"

local Level = Instance.new("IntValue", Stats)
Level.Value = SomeDataStore:GetAsync(Player.UserId.."-stats")[1] or 1
Level.Name = "Level"

local Coins = Instance.new("IntValue", Stats)
Coins.Value = SomeDataStore:GetAsync(Player.UserId.."-stats")[2] or 0
Coins.Name = "Coins"

Also, keep in mind this is not your final code. You’ll need pcalls and stuff incase Data Saving/Retrieving fails, this was only a simple example

1 Like

Ahh. Ok thanks a lot, I’ll go test it now! :smile:

1 Like