I’m trying to add a cooldown to my looting system, but I’m not sure if roblox’s time is accurate to real life. (i.e: one second in roblox = 1 second in real life). If not, is there some way to convert it?
changed: maybe yes? or not?? actually my roblox wait()
is more faster
It is. wait(1)
will wait approximately 1 second in real life. It’ll work just fine for your cooldown.
It is accurate, but not as accurate as using task.wait(1) , it updates much faster then wait(1) and now there really isn’t any reason you should be using wait(1) over task.wait(1).
You can read more on it here:
task.wait(1)
should be as close to 1 second as you can possibly get. Trying to get it any more accurate is just going to be a waste of effort and will probably make your code more unoptimised.
According to Roblox Globals, wait
“yields the current thread until the specified amount of seconds has elapsed”. So yes, the number of seconds yielded correlates to real-life time.
P.S. wait
was superseded by task.wait, which, on average, resumes 2x faster than wait
.
task.wait() is way faster than wait()
I would probably not do any wait, Instead I would do a tick() debounce as this will be most accurate