the number is growing slowly

 avatar
MatsProg
lua
2 years ago
623 B
3
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...