LockFocus
|
  |
| Joined: 31 Aug 2013 |
| Total Posts: 1044 |
|
|
| 08 Aug 2016 08:38 AM |
| ..wait for exactly 1 second. |
|
|
| Report Abuse |
|
|
| |
|
|
| 08 Aug 2016 08:42 AM |
| impossible, even in real life :) |
|
|
| Report Abuse |
|
|
Wowgnomes
|
  |
| Joined: 27 Sep 2009 |
| Total Posts: 26255 |
|
| |
|
pketny
|
  |
| Joined: 27 Dec 2010 |
| Total Posts: 1162 |
|
|
| 08 Aug 2016 09:45 AM |
local t = tick()
repeat until nil
print(tick() - t)
> 1.0000000000000
run in-game in a local script, it works! |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2016 09:49 AM |
I have several methods.
local Start = os.time() repeat wait() until os.time()-Start == 1 -- Guaranteed to wait exactly 1 second, according to os.time.
local T = tick() local Start = T() repeat until T()-Start>=1 -- Not exactly 1 second, but closer than most other things.
|
|
|
| Report Abuse |
|
|
|
| 08 Aug 2016 09:54 AM |
the only current way to wait about 1 second exactly is this
function wait2(t) local t_ = tick() while game:getService("RunService").RenderStepped:wait() do if tick()-t_ > (t or 0) then break end end return t_ end
will work like wait
wait() wait2()
wait(1) wait2(1)
and will return time passed
mine will be slightly more accurate since it checks every frame which at 60 fps is 1/60 of a second rather than 0.029999 |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2016 09:55 AM |
"local Start = os.time() repeat wait() until os.time()-Start == 1"
but OS time doesn't even have decimals... |
|
|
| Report Abuse |
|
|
pketny
|
  |
| Joined: 27 Dec 2010 |
| Total Posts: 1162 |
|
|
| 08 Aug 2016 09:56 AM |
@JarodOfOrbiter > local t = tick()
local Start = os.time() repeat wait() until os.time()-Start == 1
local p = tick() - t
print(p) 0.13239026069641
lolwut are you doing mate? |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2016 09:57 AM |
^ Yea that's why you use tick()
also mine should be the closest you can get using local scripts i believe |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2016 09:58 AM |
oops return tick()-t_,t_
this will return the time passed,game time |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2016 10:02 AM |
lmao you guys didn't get the joke ffs dumb`11 |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2016 10:02 AM |
k but yay it works kinda
1.0071811676025 |
|
|
| Report Abuse |
|
|
pketny
|
  |
| Joined: 27 Dec 2010 |
| Total Posts: 1162 |
|
|
| 08 Aug 2016 10:04 AM |
| Everyone got the joke... They are trying to find the closest way tho |
|
|
| Report Abuse |
|
|