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

How do I start counting a wait() w/ decimals / Countdown?

Asked by 4 years ago

Im making an attempt at making a value change to the amount of time that has been wait()ed already.

This was my attempt but it did not work at all how I expected

while wait(buffTime) do
    wait()
    currentTime = currentTime+.1
end
0
Could you go into further depth? I don’t quite understand. Ziffixture 6913 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago

Figured it out, I just used tick()

local timeSoFar = tick()
local currentTime = 0
delay(0,function()
    while true do wait()
        currentTime = tick()
        timeValue.Value = timeSoFar - currentTime --- update the value (current time)
    end
end)
wait(buffTime)
print(timeSoFar - currentTime) --- the time waited
Ad

Answer this question