You could think of it like that.
What I mean is to have a variable in your script that’ll tick up, and once it hits a certain point, will end.
This’ll work well with your ‘repeat until’ loop
Example of what I mean:
local var = 0
repeat wait(1)
script.Parent.Text = var
var += 1
until
var == X (X is basically how long in seconds you want this to run)
This basically adds to the number value defined at line 1, which would represent time elapsed. Though, now that I think about it, os.time() or tick() could also be used. (albeit with more work)
I have no idea how this code is even working… shouldn’t this be throwing? OP’s trying to perform an arithmetic on a string value unless compound operators tonumber their operands or something. This code is incorrect at its root.
Ideally yes though, use a numeric for loop instead. It’ll stop iterating at the lower bound.