I have a save/load system which saves and loads a players house when they join/leave, etc. Now I’m trying to work on enabling players to have multiple houses saved, so they can load between different houses.
What I had origianlly was in their data table, I had this
Plot = {
House = {},
Purchases = {}
},
Which would store all their house and items they purchased. Now I’m changing that, and insert that table automatically thru code.
So they would have a table like this
DefaultPlot = {
House = {},
Purchases = {}
},
automatically, but when they buy a new house, it would create this same table, but call it like
NewHousePlot = {
House = {},
Purchases = {}
},
So inside the players data it’d have
DefaultPlot = {
House = {},
Purchases = {}
},
NewHousePlot = {
House = {},
Purchases = {}
},
And as they buy more houses it’d keep adding more. The question is how I can add this automatically? If they also have a value of ‘House’ which defines what type of house they currently have selected
House = 'Default'
How could I check like,
PlayersData[House .. 'Plot'] -- would this return the 'DefaultPlot' table?