Numbers going up, help?

So I’m trying to create a system where the numbers go up one by one, sort of like this:

go to 0:32
if there any way to do that without for I loops?
Thank you! :smiley:

2 Likes
local i=0
while true do
    i=i+1
end

Don’t really see what else you would’ve expected.
This is also doable with a for loop, though less efficient:

for i=0, math.huge do

end

I forgot to specify(sorry): I need to increase it by a specific amount.

local amount = 10
local count = 0
for i = 1,amount do
count = count+1
end

Edit: nevermind, I thought you meant you wanted it to stop at a specific amount.
nooneisback solved it below vv

local i=0
while true do 
    i=i+5--the amount
end

This is basic programming though. Devhub literally offers this kind of code as an example.

1 Like

Is it your intention to display this number to the player or just use in within the scripts?
Sorry replying to post originator. Forgot to tag it before posting.

@twinqle
@nooneisback
well if for i loops is the only option, I’ll do it. Thanks!

(post withdrawn by author, will be automatically deleted in 1 hour unless flagged)

What exactly is the reason you want to avoid loops though?

What other option would you be looking for…?
Is there something you need that for loops can’t do?

because I don’t know the math to make it go faster or slower according to the amount of times it should repeat
@twinqle

What do you mean exactly? Just multiply the amount.

Do you mean that for certain intervals you want the amount that is added to change?

If you’re trying to recreate the original video:

local count = 0
for i = 1,10000 do
count = count + 1
end

pretend you got a score of 10, it would go up slower than if you were to have a score of 100. it’s like tweening a UI, but with numbers.
with a sine effect

Sort of, but I want it to be as smooth as possible

Oh. You’re saying that as you get closer to the ending of the count, you want it to increase slower?

slower 30characters yay done!!

local goal = 30
local count = 0
for i = 1,goal do
count = count + 1
wait(i/goal)
end

I’m currently on my phone, that’s just a guess of the algorithm you’ll need to use. See if that works.

1 Like

it does get slower, but the start is a bit too slow, how can i increase the speed at the beginning

I added a delay by subtracting .7 from the value.

local goal = 30
local count = 0
for i = 1,goal do
count = count + 1
wait(i/goal - .7)
end

Here’s the result: https://gyazo.com/b150b738dad3675fc1b40df20d16184f
Counting.rbxl (20.4 KB)

1 Like