Save position / load position not work

local ServerStorage = game:GetService("ServerStorage")
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local DataStore2 = require(ServerStorage.Modules.DataStore2)

DataStore2.Combine("Data","LastPosition")

Players.PlayerAdded:Connect(function(player)
	local character = player.Character or player.CharacterAdded:Wait()
	local LastPosition = DataStore2("LastPosition",player)

	if character:FindFirstChild("HumanoidRootPart") then
		wait(1)
		character.HumanoidRootPart.CFrame = CFrame.new(table.unpack(LastPosition:Get()))
	end
	
end)

while true do
	wait(5)
	for i,v in pairs(Players:GetPlayers()) do
		if v.Character then
			local LastPosition = DataStore2("LastPosition",v)
			if v.Character:FindFirstChild("HumanoidRootPart") then	
				LastPosition:Set({v.Character.HumanoidRootPart.CFrame:GetComponents()})
			end
		end
	end
end

i think the problem is just the loading part cuz it do be saving the position

What I think you should do is save the position using {CFrame:GetComponents()} not only does it save the position but also the exact orientation of the HumanoidRootPart and you would load their CFrame using table.unpack(LastPosition:Get())

i dont think i needa unpack cuz i can just do LastPosition:Get()[“X”] for example
it just dosnt tp me to the position when i join

Does it print something? can I see what it prints

i aded like 2 print things so this is under the heartbeat
image
this is when the player joins and gets tped
image

just used a module from roblox to tp lol

Players.PlayerAdded:Connect(function(player)
	local character = player.Character or player.CharacterAdded:Wait()
	local LastPosition = DataStore2("LastPosition",player)

	if character:FindFirstChild("HumanoidRootPart") then
		local Params = {
			destination = CFrame.new(table.unpack(LastPosition:Get())),
			faceAngle = 0,
			freeze = false,
		}
		
		wait(1)
		Teleport.Teleport(character.Humanoid, Params)
	end
	
end)