Repeated Script Points

What I’m trying to do is every second the stat would increase by 2 until it reaches it’s max point. I’ve tried this but it wouldn’t add points every second.
My script:

local stamina = 320
	local maxStamina = 320
	local value = game.ServerStorage.mate
	repeat wait()
	wait(1)
	print("test")
	stamina = stamina + 2
	updateStamina() -- this function updates the UI
	until value.Value == true

What are my options?

repeat
   local dt = wait(1)
   stamina = stamina < maxStamina and stamina + 2 or stamina -- in line logic operation
until stamina >= maxStamina or value.Value

Wait, sorry. Is the problem in presenting the data?
does updateStamina() do is job?

updateStamina() only updates the UI bar.

That script worked! Except it doesn’t update the UI right away as you receive the points.
Here is updateStamina() function.

local updateStamina = function()  
			textlabfor.Text = stamina
			staminaBar:TweenSize(UDim2.new(0.113,0,stamina/maxStamina-0.28,0),Enum.EasingDirection.Out,Enum.EasingStyle.Quad,.5,true)
	end

Tried another method using Leaderstats this time, didn’t work well either.

game.Players.PlayerAdded:Connect(function(player)
	local leaderstats1 = Instance.new("Folder")
	leaderstats1.Name = "leaderstats1"
	leaderstats1.Parent = player
	
	local points = Instance.new("IntValue")
	points.Name = "Force"
	points.Parent = leaderstats1
points.Value = 250
local value = game.ServerStorage.mate
wait(5)
local maxForce = 320
repeat wait()
repeat wait()
wait(1)
points.Value = points.Value +2
			print("gave")
until points.Value >= maxForce 
until value.Value == true
	
end)