Need help with my textlabel timer

i want to make my timer in textlabel start working when the player touches part named “checkpoint1” in folder named “checkpoints” and end when touches part named “Checkpoint59” in “checkpoints” folder

Okay, let’s say your text label is the parent.

local timerText = script.Parent.Text
local checkpoint1 = game.Workspace.checkpoints:WaitForChild("checkpoint1")
local checkpoint59 = game.Workspace.checkpoints:WaitForChild("Checkpoint59")
local timeTime = 0
local timerStart = false
local timerAvailable = true
timerText = "0"

checkpoint1.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid")  and timerAvailable then
        timerStart = true
        timerAvailable = false
    end
end)

while true do
    if timerStart then
        while timerStart do
            wait(1)
            timeTime += 1
            timeText = tostring(timeTime)
        end
    end
end

checkpoint59.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        timerStart = false
    end
end)

I haven’t tested this, it probably won’t work, however it’s something to build off of.