Make a value go slowly to another value and not directly get to it

i am trying to make a value slowly increment like from 0 to 100 it would do 1, 2, 3, 4, 5…, 100

and not 0,100

for i = 1, 100 do
	print(i)
	wait(1)
end

Is this what you are looking for?

As @KeeganwBLK stated, you need to use a loop.

yes i thought about that but i have a gui button that give a random value and i don’t know how to make it work

You can only make what your asking off of loops. What you are saying now is not 1,2,3,4,5.

i think i wasn’t able to explain myself sorry but i am trying to get an effect like this
Roblox 2022-02-04 21-43-01

where when you click the button the value doesn’t directly go from number to number but rise slowly

On the leaderboard or on the gui?

the gui (charsssssssssssssssssss)

math.random(1,100) -- results 1, 2, 3 ..., 100 with increments of 1

Try using this, TweenService | Roblox Creator Documentation
It will tween the numbers all the way up to the specific value.

That’s why @KeeganwBLK suggested a loop with a wait(1) in it.
A loop without a wait will go instantly from one value to another.
If you put a wait(# of seconds) in it the loop will cycle through more slowly. You change the number to a higher number to make the value rise more slowly, or a lower number to rise more quickly.