How can i add this to my king of the hill script

So I am a begginer developer trying to make a King of the hill game here is the list of things i want to do:

  1. make it so when you step in you gain time
  2. round ends after a certain period of time
  3. player who satys in the longest gets a stat called “Win”

Here is my script so far

local hill = script.Parent
local range = tonumber(script.Parent.Size.Y)

while true do 
	for i,v in ipairs(game.Players:GetPlayers()) do 
		if v.Character ~= nil and v.Character:FindFirstChild("Torso") then 
			if (v.Character:FindFirstChild("Torso").Position - hill.Position).Magnitude <= range then 
				v:FindFirstChild('leaderstats'):FindFirstChild("Time").Value = v:FindFirstChild('leaderstats'):FindFirstChild("Time").Value+ 1 
			end
		end
	end
	wait(1)
end