So I started working on a racing game, and I wanted to add a stopwatch for the player to see how long it took them to go over the track. This is the script:
local stopwatch = 0
function stopWatchstart()
while true do
stopwatch = stopwatch + 1
wait(1)
script.Parent.Text = (stopwatch.."")
end
end
game.Workspace.StartStopwatch.Touched:Connect(function()
stopWatchstart()
end)
The problem is (I think its the problem, correct me if I'm wrong) that it starts the timer and adds massive amounts of seconds to the textlabel. How do I detect that the player that goes through the invisible part (startstopwatch) and not a random part?
