Multiple Plot Saving System Help

Hey! So I’ve been working on a build system! I have been trying to figure how I can save multiple plots like Bloxburg how you can choose a build to save out of the ones you have! I had a few ideas:

  • Could I make a new key for each plot save and when the player selects a plot they load the key for that plot.
  • Could I make a different dictionary for each plot save.

If anyone has any better ideas or could help me figure how to do it best please comment below!

I’d set my data up like this:

local playerData = {
      ["Plot1"] = {
           PlotName = "WhateverTheySaveItAs",
           PlotObjects = {} -- contains the serialised data of saved objects in the plot
       },
       ["Plot2"] = {
           PlotName = "WhateverTheySaveItAs2",
           PlotObjects = {} -- contains the serialised data of saved objects in the plot
       }
       --etc...
}

Thank you! Is it possible to make another one of these:

 ["Plot1"] = {
           PlotName = "WhateverTheySaveItAs",
           PlotObjects = {} -- contains the serialised data of saved objects in the plot
       },

via the script automatically because there is no limit to the amount of plots you can have!

Or it doesnt have to be automatically but yeah!

Yes, you can can simply just do something like this:

local playerData = {
      PlotCount = 2,
      ["Plots"] = {
      ["Plot1"] = {
           PlotName = "WhateverTheySaveItAs",
           PlotObjects = {} -- contains the serialised data of saved objects in the plot
       },
       ["Plot2"] = {
           PlotName = "WhateverTheySaveItAs2",
           PlotObjects = {} -- contains the serialised data of saved objects in the plot
       }
       --etc...
       }
}

Sorry for the formatting, but with the addition of PlotCount, you can simply do

local playerPlotCount = playerData.PlotCount
playerData.Plots[“Plot”…playerPlotCount + 1] = {
PlotName = “PlotName”,
PlotObjects = {}
}

playerData.PlotCount += 1

Or you could remove PlotCount and use a For Loop to count how many keys are inside the dictionary and simply +1.

1 Like

Thank you so much! That helps a lot!

Wait one more question sorry! Would

local playerPlotCount = playerData.PlotCount
playerData.Plots[“Plot”…playerPlotCount + 1] = {
PlotName = “PlotName”,
PlotObjects = {}
}

playerData.PlotCount += 1

go when you wanted to add a new plot correct??

Hey you wouldnt know how to load a new plot and unload the current one you have would you? Im struggling with it!