the number is growing slowly
MatsProg
lua
3 years ago
623 B
4
Indexable
function slowlyIncreasingNumber(currentTime)
local timeScale = 0.01 -- Adjust this value to change the speed of the increase
local minValue = 1
local maxValue = 1000
local valueRange = maxValue - minValue
local timeOffset = 0 -- Adjust this value to change the starting point of the increase
-- Calculate the current value based on the current time
local currentTimeOffset = currentTime + timeOffset
local rawValue = math.sin(currentTimeOffset * timeScale)
local scaledValue = (rawValue + 1) / 2
local currentValue = scaledValue * valueRange + minValue
return currentValue
end
Editor is loading...