function Counter(distance,lower,func)
local floor,tick,wait = math.floor,tick,wait
--distance = distance + 1
-- un comment the last line to make it start at the beginning of the number
local start = tick()
while true do
local time = tick()
local current = distance - (time - start)
if current <= 0 then
break
elseif current < lower then
func(floor(current/0.1)*0.1)
else
func(floor(current))
end
wait()
end
end
Counter(60,24,function(time) print(time) end)
|