Is there a way to save and load a model's CFrame (position and rotation) using DataStore or some other way to save and load data after a player has joined/left? Something like Miners Haven where it saves everything on your base and loads it when you join.
I just need to know if using DataStore is the correct method in doing so, and if so, I'd like to know a brief guideline on how I should go about using DataStore to store the CFrame values to prevent DataStore from being overloaded.
Any guidance will be greatly appreciated!
To save something like CFrame in data store you simply save a table of its values, then unpack the table later. Rough example:
local cf = CFrame.new() local tab = { cf:components() } --components is a tuple of values datastore:SetAsync('key',tab) --later local tab = datastore:GetAsync('key') local cf = CFrame.new(unpack(tab))