Could Someone Please Explain The "TimeSyncManager" Module Made By Quenty?

Hi, I was recently referred in this post to TimeSyncManager made by @Quenty . It is a module that helps sync time between server and client. But wait, theres a problem…

I don’t know how it works, and don’t understand what does what enough to actually want to use the module. If anyone could care to explain, I would really appreciate it. Thank you.

1 Like

Have you tried DMing Quenty and asking?

4 Likes

I’ve come across a post like that over here , you can use it to calculate the time passed after an event has fired, or for synchronized time between the Client and the Server.

Quote from TheGamer101 from the mentioned thread,
2 Likes

I’ve updated it to TimeSyncService!

Call :Init() on the client and server!

Then, you can get a synced clock, which is guaranteed to be synced.

-- main script, does not yield, so this on the client and server
require("TimeSyncService"):Init()

-- other script 
local TimeSyncService = require("TimeSyncService")

local syncedClock = TimeSyncService:GetSyncedClock() -- Yielding potentially on client! 

print(syncedClock:GetTime())

Alternatively you can use promises to get a synced clock:

-- main script, does not yield
require("TimeSyncService"):Init()

-- other script 
local TimeSyncService = require("TimeSyncService")

-- yay no yielding 
TimeSyncService:PromiseSyncedClock():Then(function(syncedClock)
    print(syncedClock:GetTime())
end)

This will result in a timestamp that is synchronized with the server! Accuracy is ± 1/30

22 Likes

Thank you so much, this will be really helpful to me and many others who are looking for what I was looking for!

2 Likes

How do I import it? I think I’m missing something. I imported the time sync script directly, but it looks for several other subscripts, it appears. Is there an easy way to install, or some sort of guide?

Just checking you have Nevermore installed right?