How do i tween a variable

so i have a thing called a gametick in my game, basically image it as minecrafts gametick.
Every tick the game processes some info right?
I have a command that lets you change the gametick, but i want it to tansition over to the new tick.

How do i tween my number?

Is this what you mean?

local gameTick = 10

function changeGameTick(newTick)
	while gameTick ~= newTick do
		if gameTick < newTick then
			gameTick = gameTick + 1
		elseif gameTick > newTick then
			gameTick = gameTick - 1
		end
		print("Current gameTick: " .. gameTick)
		wait(0.1)
	end
	print("Final gameTick: " .. gameTick)
end

-- Example
changeGameTick(20)

no i want to tween it not jusr change it

This method creates a number value to tween

local function tweenNumber(endValue, duration)
	local TweenService = game:GetService("TweenService")
	local numberValue = Instance.new("NumberValue", game.Workspace)

	local tweenInfo = TweenInfo.new(duration or 1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
	local goal = { Value = endValue }

	local tween = TweenService:Create(numberValue, tweenInfo, goal)
	tween:Play()

	numberValue.Changed:Connect(function(property)
		print(numberValue.Value)
	end)

	tween.Completed:Connect(function()
		numberValue:Destroy()
	end)
end

tweenNumber(100, 5)