Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Whats happened to day/night cycle?

Asked by
proo34 41
5 years ago

I have been working on a Day/Night cycle for my friends game. Its a realistic on though so it has more effects than just changing the time of day. It sets the flog closer and everything gets darker. I've been working on it be when I do, it lags like crazy! I'm really confused because it never did this before. Any idea on why?

1 answer

Log in to vote
-1
Answered by 5 years ago

Test this it wont lag and it is pretty good!

Time = game:service("Lighting")

 while true do
     wait(0.01)
     Time:SetMinutesAfterMidnight(Time:GetMinutesAfterMidnight()+0.1)
 end

Mark mine if it works!

0
And It might be because of a overload of lines if you doing it in a way of frames it could glitch it and you might need to add a denounce if not I really don't know but the script I used is simple its only just 4 lines. vincentthecat1 199 — 5y
0
this doesnt lag thanks! proo34 41 — 5y
0
this refreshes 100 times a second sayer80 457 — 5y
Ad

Answer this question