How fix problem in obby

When I enter the game, I appear at the beginning, when I press reset, I appear at stage 19.

-- :3
local ds = game:GetService("DataStoreService"):GetDataStore("StatsStore4")

	local playerFolder ="Folder")
		playerFolder.Name = "leaderstats"
		playerFolder.Parent = player

	local ack2 ="IntValue")
		ack2.Name = "Stage"
		ack2.Value = 1
		ack2.Parent = playerFolder
	local savestuff = ds:GetAsync(player.UserId)	
	--print("data takes up ".. game:GetService("HttpService"):JSONEncode(savestuff):len().. "/260000")
local StatsFile = player.leaderstats
	if savestuff then
		for i,v in pairs(savestuff) do
			if i % 2 == 0 then
				StatsFile:FindFirstChild(savestuff[i - 1]).Value = v

local function saveValues(player)
	local saveData = {}
	local StatsFile = player.leaderstats

	for i,v in pairs(StatsFile:GetChildren()) do
			saveData[#saveData + 1] = v.Name
			saveData[#saveData + 1] = v.Value
	ds:SetAsync(player.UserId, saveData)

	for i, player in pairs(game.Players:GetPlayers()) do


function oa(object)
	local player = game.Players:playerFromCharacter(object)
	if player ~= nil then
		local ls = player.leaderstats
		local sl = game.Workspace.Checkpoints:FindFirstChild(ls.Stage.Value)
		object.Torso.CFrame = object.Torso.CFrame +,3,0)
		object.Torso.CFrame = sl.CFrame +,3,0)

Thank you for help DevForum nice

The player HRP CFrame is to the teleport part CFrame so try rotate it.

Make sure that there isnt any spawn location that is making you spawn in there

nothing. only checkpoints/////

Shouldn’t it be game.Workspace.ChildAdded:connect(oa()) or am i just being dumb? And where is the parameter for the object?

I changed but the problem is the same

What do you mean? i’m confused

That literally doesn’t solve the problem

Also do you always spawn at the beginning and then spawn in a stage you were in?

When I join the game, I’m at the beginning, when they reset the character, I appear at the stage where I was, and then everything is fine.

If you look at the picture in the bottom right, it says to reset if you are not on your stage. The code is working as intended, as I assume you took this from a freemodel.

Are you getting any errors? If so then that might be the case

Yes, I took it because I’m just a 3Modeler and not a programmer

What are you trying to achieve here? Are you wanting the player to move to the last stage they were at when they join the game, are you trying to get the player to go the beginning when they reset their character?

Taking freemodels is fine, especially for learning scripting. There’s no shame in using them, though it’s good practice not to when you become better at scripting. So what exactly do you want to fix? Do you want to reset and stay at stage 1? Do you want to spawn at the stage you’re at?

The game has a date store for saving checkpoints, and I reached stage 19, re-entered and I appeared at the beginning, although stage 19 is written in the corner, and when I reset a character I appear at stage 19.

Freescripts*, i don’t like learning scripts, and i don’t have lot time

So you want the player to go straight to stage 19(or the stage they were last at) when they join the game?

Then i would recommend you hire one. Its what makes your games fun