How to make non-savable checkpoint system?

Im trying to make an obby with a non-savable checkpoint system. I already got my folder named “Stages” in workspace with all the checkpoints in it.
My knowledge in scripting is extremely limited so I’d appreciate any help.
Thanks

here is the script

local StageData = game:GetService("DataStoreService"):GetDataStore("StageData")

local Checkpoints = workspace:WaitForChild("Checkpoints"):GetChildren()

function GoToCheckpoint(character, stage)
    local rootPart = character:WaitForChild("HumanoidRootPart")
    repeat wait(0.00) until rootPart

    for i, checkpoint in pairs(Checkpoints) do
        if ("Checkpoint" .. tostring(stage)) == checkpoint.Name then
            rootPart.CFrame = checkpoint.CFrame * CFrame.new(0, 1, 0)
            break
        end
    end
end

game:GetService("Players").PlayerAdded:Connect(function(player)
    local leaderstats = Instance.new("Folder", player)
    leaderstats.Name = "leaderstats"

    local stage = Instance.new("IntValue", leaderstats)
    stage.Name = "Stage"
    stage.Value = StageData:GetAsync(player.UserId) or 1

    player.CharacterAdded:Connect(function(character)
        GoToCheckpoint(character, stage.Value)
    end)
end)

for i, checkpoint in pairs(Checkpoints) do
    checkpoint.Touched:Connect(function(touch)
        local hum = touch.Parent:FindFirstChild("Humanoid")
        if hum and hum.Health > 0 then
            local player = game:GetService("Players"):GetPlayerFromCharacter(touch.Parent)
            if player then
                local leaderstats = player:WaitForChild("leaderstats")
                local stage = leaderstats:WaitForChild("Stage")
                if (tonumber(checkpoint.Name:match("%d+")) - stage.Value) == 1 then
                    stage.Value = stage.Value + 1
                end
            end
        end
    end)
end

game:GetService("Players").PlayerRemoving:Connect(function(player)
    StageData:SetAsync(player.UserId, player.leaderstats.Stage.Value)
end)

I tried that script, and it doesn’t work

Can you tell what errors does it say i can fix for you;