Sync your time with the server

Learn how to sync your time with the server time.

by FroschCrafterLP

Author Avatar

How can I sync my time with the server time?

That is a good question and whe would instruct you step by step how to do that.

1:

You are insert a new script to the ServerScriptService

2:

Then you are take the real time in a local value at the first line like...

local timeTable = os.data("*t", os.time())

3:

Then you are do the server time to the convertet time like...

local timeTable = os.data("*t", os.time())
game.Lightning.TimeOfDay = timeTable.hour..":"..timeTable.min..":"..timeTable.sec

4:

You are do a while wait(1) loop like this.

local timeTable = os.data("*t", os.time())
game.Lightning.TimeOfDay = timeTable.hour..":"..timeTable.min..":"..timeTable.sec

while wait(1) do

end

5:

Then you are do the same thing like in step 3

local timeTable = os.data("*t", os.time())
game.Lightning.TimeOfDay = timeTable.hour..":"..timeTable.min..":"..timeTable.sec

while wait(1) do

    game.Lightning.TimeOfDay = timeTable.hour..":"..timeTable.min..":"..timeTable.sec

end

The step by step istruction is at the end and now the script will sync your time with the server time

/ / Here is the whole script / /

local timeTable = os.data("*t", os.time())
game.Lightning.TimeOfDay = timeTable.hour..":"..timeTable.min..":"..timeTable.sec

while wait(1) do

    game.Lightning.TimeOfDay = timeTable.hour..":"..timeTable.min..":"..timeTable.sec

end

Thank you for listening to the tutorial and I hope it did help you!

View in-game to comment, award, and more!