Grabbing Server Time in Lua

Posts 1–2 of 2 · Page 1 of 1
Grabbing Server Time in Lua
Since apparently nobody is grabbing servertime correctly I figured I'd post a way to get it properly.

Code:
local properCurTime = 0
hook.Add("Move", "GrabServerTime", function()
	if ( IsFirstTimePredicted() ) then
		properCurTime = CurTime() + engine.TickInterval()
	end
end)
According to NanoCat the one on his pastebin wasn't recovered properly, the one that Kelse's pastebin is off by a tick.
Quote Originally Posted by Ariaa View Post
Since apparently nobody is grabbing servertime correctly I figured I'd post a way to get it properly.

Code:
local propperCurTime = 0
hook.Add("Move", "GrabServerTime", function()
	if ( IsFirstTimePredicted() ) then
		propperCurTime = CurTime() + engine.TickInterval()
	end
end)
According to NanoCat the one on his pastebin wasn't recovered properly, the one that Kelse's pastebin is off by a tick.
thx 4 releesed
Posts 1–2 of 2 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us