Making a day leaderstats

Whenever it completes a whole days which I mean if it hit the 24 hour it will print New day!
Apparently it isn’t printing
Day/Night Cycle Script:

local Cycle = 0.1

while wait() do
	game.Lighting.ClockTime += Cycle
end

New day script:

while wait() do
	if game.Lighting.ClockTime == 24 then
		print("New day!")
	end	
end

Why isn’t it printing New day!…?

I can see a few problems off the bat. You used == which, if you have a script running as fast as your time ‘changer’ script is, doesn’t always run while it equals 24, in your case, try using >= instead. If your time ‘changer’ script is a LocalScript while the other is a ServerScript, and vice versa, the values won’t be readable.

2 Likes