Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I datastore a part position?

1 answer

✓ Accepted answer

I would create a dictionary for each part and their separate values, like so.

local part1 = game.Workspace.Part1
local part2 = game.Workspace.Part2

local partsPositon =
{
	Part1Pos =
		{
			["X"] = part1.Position.X,
			["Y"] = part1.Position.Y,
			["Z"] = part1.Position.Z
	},

	Part2Pos =
		{
			["X"] = part2.Position.X,
			["Y"] = part2.Position.Y,
			["Z"] = part2.Position.Z
	}
}

And then when they leave you can use :SetAsync() with the new position, and use :GetAsync() to set the positions when they join back.

Hope this gave you and idea!

DataStore Wiki

Dev Forum Table

Dev Forum Dictionary

This discussion is preserved as it was. New answers, comments, and votes are closed.