Problem is likely because of mismatch in your saved position table, in your saving code you create the table like this:
local pos = {
X = dest.CFrame.X,
Y = dest.CFrame.Y,
z = dest.CFrame.Z
}
And later in your loading code you try to access it as pos.Z
as uppercase letter. Tables are sensitive, so “z” and “Z” are two different keys. If you change that bit to this below, it might work.
local pos = {
X = dest.CFrame.X,
Y = dest.CFrame.Y,
Z = dest.CFrame.Z
}
After tring this, tell me if there are any errors in output, peace!