I've put this code in a server-script, loadstringenabled, And there are no errors either. And the script doesn't seem to work when trying to test.
wait(1)
game.OnClose = function()
local Data=game:GetService("DataStoreService"):GetDataStore("Load")
game.Players.PlayerAdded:connect(function(plr)
if plr.DataReady==true then
local pos = Data:GetAsync(plr.userId)
if pos then
plr:FindFirstChild("Character"):MoveTo(Vector3.new(pos.x, pos.y, pos.z))
end
end
end)
game.Player.PlayerRemoving:connect(function(plr)
if plr.DataReady==true then
local v3 = plr:WaitForChild("Character"):FindFirstChild("Torso").Position
Data:SetAsync(plr.userId, {x = v3.x, y = v3.y, z = v3.z})
end
end)
end

4 comments
No help.
@NotNowSkid Your comment is also no help (ex, what part don't you understand, or isn't working?). If you want help on this site you need to be willing to put work in.
You could've helped by fixing/ or editing my code I would've understood better I believe.
This site is about learning how to code better, not having other people fix your scripts. That said, delete lines 2, 7, 11, 16, 19, 21. That should get it operating most of the time.