Okay, I have figured out a issue.
Replace your current script two with this one.
player.PlayerAdded:connect(function(plr)
local stats = Instance.new("Folder")
stats.Name = "leaderstats"
stats.Parent = plr
local stage = Instance.new("IntValue")
stage.Name = "Stage"
stage.Parent = stats
local data = saveDataStore:GetAsync(plr.UserId)
if data then
print(data.Stage)
for _,stat in pairs(stats:GetChildren()) do
stat.Value = data[stat.Name]
end
else
print(plr.Name .. " has no data")
end
coroutine.resume(coroutine.create(function() -- Keeping track of data.
local rn = nil
rn = game:GetService('RunService').Heartbeat:connect(function()
if plr and player:FindFirstChild(plr.Name) then
local dat = nil
if Inter[plr.Name] == nil then
Inter[plr.Name] = {}
dat = Inter[plr.Name]
else
dat = Inter[plr.Name]
end
for _,stat in next,plr.leaderstats:GetChildren() do
dat[stat.Name] = stat.Value
end
else
rn:Disconnect()
end
end)
end))
plr.CharacterAdded:connect(function(char)
local humanoid,hrp = char:FindFirstChild("Humanoid") or char:WaitForChild("Humanoid"),char:FindFirstChild("HumanoidRootPart") or char:WaitForChild("HumanoidRootPart")
if humanoid and hrp then
if stage.Value ~= 0 then
local part = workspace.ObbyStages:FindFirstChild(stage.Value)
hrp.CFrame = part.CFrame + Vector3.new(0,1,0)
end
end
end)
local char = plr.Character or plr.CharacterAdded:Wait()
char = plr.Character
local humanoid,hrp = char:FindFirstChild("Humanoid") or char:WaitForChild("Humanoid"),char:FindFirstChild("HumanoidRootPart") or char:WaitForChild("HumanoidRootPart")
if humanoid and hrp then
if stage.Value ~= 0 then
local part = workspace.ObbyStages:FindFirstChild(stage.Value)
hrp.CFrame = part.CFrame + Vector3.new(0,1,0)
end
end
end)
The issue was the humanoid or humanoidrootpart did not exist, and so I had to change a few things, it should work now though.
And also, thanks.
Well how do I tell you this? It worked fine at first, that is, when I entered the game I appeared at my corresponding level, everything was fine, until I went to the next level and rebooted the character, it took me to the beginning. Leaderboard number changed, so far ok, but when I advance levels the checkpoint is not saved. But at least it fixed the problem that got you in the beginning WHEN YOU ENTER THE GAME, but now that it has been fixed, the new checkpoints you touch are not saved. Just that and nothing else, another piece of information is that the game is R6. Anyway, thanks for all your effort to help me, I hope you can find the problem.
Excuse me if you donāt understand me well, since I speak Spanish, my English may not be very good.
I will try to record a video to show you the problem
Uhm nuevo dato: Ahora ya no me lleva ni a mi nivel, osea no cambió nada, sigue igual que antes. ¿Sabe que podria ser? 
? I donāt speak spanish, only english
Oh. I donāt really know what it could be, I suggest just remaking the entire script.
Untitled Game - Roblox In case you want to see it yourself
Replace your script two with this
local PS = game:GetService("Players")
local dataStoreService = game:GetService("DataStoreService")
local SDS = dataStoreService:GetDataStore("SaveDataTest")
local Inter = {
-- EX: ["Obj_ective"] = {DATA HERE}
}
PS.PlayerAdded:connect(function(p)
local ls = Instance.new("Folder")
ls.Name = "leaderstats"
ls.Parent = p
local s = Instance.new("NumberValue")
s.Name = "Stage"
s.Parent = ls
-- Data Reconaissance
local d = SDS:GetAsync(p.UserId)
if d == nil then
d = {}
else
for _,stats in next,ls:GetChildren() do
if d[stats.Name] then
stats.Value = d[stats.Name]
end
end
end
p.CharacterAdded:connect(function()
local s = p.leaderstats.Stage
if s.Value ~= 0 then
local stage = workspace.ObbyStages:FindFirstChild(s.Value)
local c = p.Character or p.CharacterAdded:Wait()
c = p.Character
local hrp = c:FindFirstChild("HumanoidRootPart") or c:WaitForChild("HumanoidRootPart")
if stage then
hrp.CFrame = stage.CFrame
hrp.Position = hrp.Position + Vector3.new(0,1,0)
end
end
end)
if s.Value ~= 0 then
local stage = workspace.ObbyStages:FindFirstChild(s.Value)
local c = p.Character or p.CharacterAdded:Wait()
c = p.Character
local hrp = c:FindFirstChild("HumanoidRootPart") or c:WaitForChild("HumanoidRootPart")
if stage then
hrp.CFrame = stage.CFrame
hrp.Position = hrp.Position + Vector3.new(0,1,0)
end
end
coroutine.resume(coroutine.create(function() -- Keeping track of data.
local rn = nil
rn = game:GetService('RunService').Heartbeat:connect(function()
if p and PS:FindFirstChild(p.Name) then
local dat = nil
if Inter[p.UserId] == nil then
Inter[p.UserId] = {}
dat = Inter[p.UserId]
else
dat = Inter[p.UserId]
end
for _,stat in next,p.leaderstats:GetChildren() do
dat[stat.Name] = stat.Value
end
else
rn:Disconnect()
end
end)
end))
end)
PS.PlayerRemoving:connect(function(p)
local data = Inter[p.UserId]
if data then
SDS:SetAsync(p.UserId,data)
end
end)
game:BindToClose(function()
for _,Player in next,PS:GetPlayers() do
local data = Inter[Player.UserId]
if data then
SDS:SetAsync(Player.UserId,data)
end
end
end)
New script two
local PS = game:GetService("Players")
local dataStoreService = game:GetService("DataStoreService")
local SDS = dataStoreService:GetDataStore("SaveDataTest")
local Inter = {
-- EX: ["Obj_ective"] = {DATA HERE}
}
PS.PlayerAdded:connect(function(p)
local ls = Instance.new("Folder")
ls.Name = "leaderstats"
ls.Parent = p
local s = Instance.new("NumberValue")
s.Name = "Stage"
s.Parent = ls
-- Data Reconaissance
local d = SDS:GetAsync(p.UserId)
if d == nil then
d = {}
else
for _,stats in next,ls:GetChildren() do
if d[stats.Name] then
stats.Value = d[stats.Name]
end
end
if s.Value ~= 0 then
local stage = workspace.ObbyStages:FindFirstChild(s.Value)
local c = p.Character or p.CharacterAdded:Wait()
c = p.Character
local hrp = c:FindFirstChild("HumanoidRootPart") or c:WaitForChild("HumanoidRootPart")
if stage then
hrp.CFrame = stage.CFrame
hrp.Position = hrp.Position + Vector3.new(0,1,0)
end
end
end
p.CharacterAdded:connect(function()
local s = p.leaderstats.Stage
if s.Value ~= 0 then
local stage = workspace.ObbyStages:FindFirstChild(s.Value)
local c = p.Character or p.CharacterAdded:Wait()
c = p.Character
local hrp = c:FindFirstChild("HumanoidRootPart") or c:WaitForChild("HumanoidRootPart")
if stage then
hrp.CFrame = stage.CFrame
hrp.Position = hrp.Position + Vector3.new(0,1,0)
end
end
end)
coroutine.resume(coroutine.create(function() -- Keeping track of data.
local rn = nil
rn = game:GetService('RunService').Heartbeat:connect(function()
if p and PS:FindFirstChild(p.Name) then
local dat = nil
if Inter[p.UserId] == nil then
Inter[p.UserId] = {}
dat = Inter[p.UserId]
else
dat = Inter[p.UserId]
end
for _,stat in next,p.leaderstats:GetChildren() do
dat[stat.Name] = stat.Value
end
else
rn:Disconnect()
end
end)
end))
end)
PS.PlayerRemoving:connect(function(p)
local data = Inter[p.UserId]
if data then
SDS:SetAsync(p.UserId,data)
end
end)
game:BindToClose(function()
for _,Player in next,PS:GetPlayers() do
local data = Inter[Player.UserId]
if data then
SDS:SetAsync(Player.UserId,data)
end
end
end)
Okay, it is fixed.
Thereās a little issue where youād pop at the start for a second, but then instantly go back to where you left off, but it shouldnāt be that big of a deal.
And plus, the spawnlocation is overriding(replacing) the characterās position, and preventing them from going to their last checkpoint, which is why I added a wait() or a repeat until.
I used repeat until so that it would minimize the maximum attempts at making the player go to their last location. But at least it worked.
HEAR I AM SERIOUSLY APOLOGIZED, I DONāT KNOW WHAT HAPPENED TO THE INTERNET AND IT WONāT LET ME CONNECT. And answering what you told me, is there no way to avoid that waiting time at startup? It is that with the other script that did not happen, and yes, it is a problem for me.
You can remove the spawnlocation, and then remove the ārepeat untilā part in āplrhandleā script.
Excuse me, donāt take it the wrong way, maybe the translator will put it differently. But if you could do what it says to avoid the waiting time. Why didnāt he do that at first and leave it like that before he left? I think it sounds bad like I said it in English, but in Spanish it looks good.
Well thereās a point between you being okay with it, and youāre not.
I donāt want to cross that point.
Which is why I only modified āPlrHandleā, and not anything else in the game.
Excuse me, I did not understand very well what you said about how to solve that waiting time. Is there no other simpler way?
you could do it? I can leave the checkpoints in a package and he does it in his studio
hi, a question, do you know what the user Obj_ective is referring to by āYou can remove the build location and then remove theā repeat until āpart in theā plrhandle "script?
can you help me? only that problem would be missing