Hey Cuvette,
You can indeed save the house data to DataStore by way of SetAsync and UpdateAsync, both methods of GlobalDataStore. The Wiki page:
http://wiki.roblox.com/index.php?title=API:Class/GlobalDataStore
Keep in mind, you cannot save instances to a GlobalDataStore. You can, however, get away with saving a tables like this to DataStore:
local position = part.Position;
{
Position = {
x = position.x;
y = position.y;
z = position.z;
};
BrickColor = part.BrickColor.Name;
};
Rinse and repeat for each part in the house and save each entry in a list. Publish the list using DataStore, and get it back using GetAsync. When you retrieve the list, iterate over it and use a function like this to render each entry:
local function ConvertEntry(entry)
local part = Instance.new("Part", path.To.Parent);
local position = entry.Position;
part.BrickColor = BrickColor.new(entry.BrickColor);
part.Position = Vector3.new(position.x, position.y, position.z);
end;
There are other ways you might achieve this. If your house behaves more like a tycoon, you might make an entry for each available upgrade:
{
Walls = true;
Roof = true;
KitchenSink = false;
};
Again, you'd iterate over this table and render the respective prefabricated upgrades depending on their respective upgrade values.
I highly recommend checking out the following Wiki pages to learn more:
http://wiki.roblox.com/index.php?title=API:Class/DataStoreService
http://wiki.roblox.com/index.php?title=API:Class/GlobalDataStore
http://wiki.roblox.com/index.php?title=Data_store
Have a nice day, Cuvette, and best of luck with your game!
Warm regards,
tkcmdr
3 comments
Thanks for the answer, I was hoping there would be a quicker way to do this, as most of the models inside the house have scripts, intValues and all sorts inside them. It would be easier to use Data Persistance if it worked properly.
Ouch, bud. Sorry to hear that. I'd recommend looking into a more efficient (and easily modifiable) method to making future games. If I may, I'd like to suggest checking an example place I made:
https://drive.google.com/file/d/0BzgG1h35hYeSaVJOUElnYjVoRGs/view?usp=sharing