Is there ANY possible way to save a instance into a data store? If there is please inform me of it.
I don't believe there's a way to save instances just yet if I recall correctly. Unless the instance is modified in the course of the play session, you can save the Name
property of the instance, and then load it up later based on said Name.
Otherwise, you might be able to convert instances and their properties into strings or tables of strings, and then saving those to the data stores. You would then have to set the properties from the fetched string to the instance.
It would work look something similar to this.
local package = { instance1 = { Parent= model; ... } instance2 = { Parent = model; ... } } x = Instance.new('Part') x.Name = 'instance1' for i,v in next, package[x.Name] do x[i] =v end
Here is a module by Stravant that should help solve your issue: EncodeInstance Module
Yes, just save it as it is:
local ds = game:GetSerivce("DataStoreService"):GetDataStore("Instances") --You cannot save instances so you should turn it into a string/table ds:SetAsync("Part", {workspace.Part}) --See if this works --To access this part you need to do: ds:GetAsync("Part")[1] --Part ds:GetAsync("Part")[1].BrickColor = BrickColor.Random()
Hope it helps!(It is late so I need to finish this quickly! Sorry if it's too short.)
The problem with saving is, I was thinking about LoadInstance and SaveInstance, but that is Data Persistence not Data Stores (Silly me). Anyway I think it's fixed.