if not Touched then line not breaking the while loop
local debounce = false game.Players.PlayerAdded:Connect(function(player) local stats = Instance.new("IntValue", player) stats.Name = "leaderstats" local Time = Instance.new("IntValue", stats) Time.Name = "Time" Time.Value = 0 local function AddTime(Touched) while Touched do wait(1) if debounce == false then Time.Value = Time.Value + 1 debounce = true wait(1) debounce = false end if not Touched then break end end end workspace.Models.BASEPLATE.Touched:Connect(AddTime) end)