Problem of ModuleScript to getting accurate real time (Using Nevermore Engine)

Hello. I’m looking for getting accurate real time, using Nevermore Engine.

I wanted to getting accurate universal real time, so I tried to run as os.time()+tick()%1 but it got lag and got confused outputs. so I checked up Topic of ‘Sync tick() for client and server’, and solution uses Nevermore Engine. so I just tried to use this module for my game (already installed). but I haven’t been used ModuleScript, so I’m very confused at making output of accurate real time.

I know It’s a simple question, but I can’t understand how ModuleScript works, so I want an advice to achieve this. Thanks for advance!

1 Like

By the looks of it, you should just be able to do:
local serverClock = require(ReplicatedStorage.Path.To.TimeSyncManager)
in a single server script (only once!), and then where ever you need the clock on the client, just do the same code in a locally required module script or local script:

local clock = require(ReplicatedStorage.Path.To.TimeSyncManager)

clock:GetTime() -- Should be as close to the server’s time as you can get

It looks like you’re able to create multiple on the client without any weird issues, but for simplicity and memory leak prevention, I recommend only creating one and passing it around your client.
The TimeSyncManager can determine if the code is being run on the client or the server, so there’s no need for specifying.

3 Likes