Saving parts/models via datastore?

If you don’t need to account for orientation, you can simply take away the tycoonBaseplate’s position when saving, and add it back on when you load. for example:

saving:

local position = primaryPart.Position - tycoonBaseplate.Position

loading:

local position = Vector3.new(information[1], information[2], information[3]) + tycoonBaseplate.Position

Back when i made restaurant tycoon, I didn’t know how to deal with the problem of orientation so I simply put all the tycoons in one long line. xD

However, since you need to account for the orientation, you need to use the CFrame of the tycoon baseplate instead of position.

saving:

local position = tycoonBaseplate.CFrame:inverse() * primaryPart.Position

loading:

local position = tycoonBaseplate.CFrame * Vector3.new(information[1], information[2], information[3])

I hope that works and i hope it makes sense!

10 Likes