How can I create plot saving system?

I have seen module that converts objects to table and you can save it, the problem is I heavily do not understand how I would even start to script a data saving system for plots or how data service works anyway. I have tried to understand but I can’t

I want plots like this:

image

when player joins, it loops through to see if plot taken. if not it gives player that plot. ONLY problem is that, If I were to build something on my plot, or grab something on my plot, saving isn’t implemented. Once you leave then come back your plot is just as empty as before.

I want a plot system that saves every single property of a part, then to load it back on the plot when the player joins

1 Like

You can do that by taking a object’s position and rotation then subtracting the plot offset from those values. Then insert some identification and the objects position and rotation with the offset subtracted into a table and store that table

1 Like

but I need the explanation how to use data store to load and save the parts

1 Like

I just gave you the entire basic thing for saving.

1 Like

how do I load and save it table. I am planning to make the table save when player leaves, after it saves clear plot, and when player join, it loads table. But how do I store table?

Here’s a general idea

saveTable = {}

for i, item in plotfolder:GetChildren() do
    table.insert(saveTable, {itemtypehere, itemlocationrelativetoplotcentrehere})
end

-- SetAsync(player.UserId.."_plotsave", saveTable)

GetAsync will return a table of the format
{{itemtypehere, itemlocationrelativetoplotcentrehere}, {itemtypehere, itemlocationrelativetoplotcentrehere}, etc}

this is basically what I done after understanding so I’ll mark this as a solution

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.