Help with stopwatch End using checkpoints!

Hello, I am making this topic because I need a bit of help with ending the stopwatch that I created.

I am trying to make it so that when a certain checkpoint is touched, the timer will stop. The way that I have my system set up is in a way where it is possible to easily script multiple time trials to happen across my map.
I have looked all over the Dev Forum to find a solution but I couldn’t find anything remotely close to what I was trying to accomplish.

function CaptureEndTime()
	CBActive.Finish.Touched:Connect(function(hit)
		if hit.Parent == workspace.Ignore:WaitForChild(PLAYER.Name.."Bike") then
			if not debounce then
				debounce = true 
					print(TimerLabel.Text)
				wait(1)
				debounce = false
			end	
		end
	end)
end

When the bike touches the finish checkpoint, the print function prints out the timer’s text at the time of touching it, ‘recording’ it in a way.

I have found a way to record the time just using the text label I set up but I have no way to stop the timer internally and to stop the timer externally on the actual Text label itself. Please let me know if you need any more explanation!

A BoolValue would be great here, you can use it’s Value as the condition to the timer while loop and then assign it to false when you want it to stop (ensure it’s true to begin with).

ooh! Thank you so much, I will try this right now. I will get back to you with any errors or anything. Thanks!


I don’t know exactly how I would go about doing this but do you know how I would make this work? The BoolValue is parented to the script and called here in the function, is there another way I should go about doing this?

You forgot, a “.Value” on the 7th line, and you currently tries to compare a Userdata with a Boolean.

Thanks! I managed to find a way to fix it! And I used the right variables. Thanks!