Synchronize Day/Night Cycle on Client Without Remote Events

I am creating a day/night cycle, and I need all the clients to have the same or really close time of day. Without the usage of remote events (except for like, maybe one), how could I ensure all the clients have the same time of day, without tweening on the server?

2 Likes

There’s a guy by the name of Suphi Kaner who made this video:

Its explained really well on how to do this and you also get to learn time syncing between server and client, have a nice day!

3 Likes

Doesn’t the Lighting service have properties: TimeOfDat and ClockTime?

Anyways, you can also use Instance Attributes to make a custom day or something.

1 Like

Have a NumberValue or Attribute that both the server and client can see, on the Server add to it by a set amount every set amount of time, numbers up to you. Then, on the client when the NumberValue or Attribute changes you tween Lighting.ClockTime to the value.

You’d need to setup logic on the server so that when the value goes above 24 it resets back to 0, and on the client when the value becomes 0 you need to set Lighting.ClockTime instead of tweening so it doesn’t tween backwards to 0.

New clients joining might have issues with this
And this is just a tween with extra steps…

He wanted to avoid tweening on the server, so that was my solution. To fix new people joining you just set the ClockTime to the value when the script starts before you start tweening.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.