Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with this function?

Asked by 10 years ago

I created a function that counts down from argument to another then uses the wait method to wait until it's complete,but it won't continue with thread once its done.Why and how do I manage to fix it?

function Countdown(StartTime,EndTime)
-------------------------------------
    local Library = assert(LoadLibrary("RbxUtility"))
    local Signal = Library.CreateSignal()
-------------------------------------
    for i = StartTime,EndTime do
        print(i)
        if i == EndTime then
            Signal:fire()
            return Signal:wait()
        end
    end
end

Countdown(1,10)
print('Countdown Finished')
print('yay')

Answer this question