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

Normal Time and how to fix the script?

Asked by
DDM_DD 6
6 years ago
Edited 6 years ago

So I was making a game and the time was Military time and I want to it to be normal time and I don't want to use free models the code was this:

local ClockTime = game.Lighting.ClockTime
game.Lighting.ClockTime = 9
local minutesAfterMidnight = 540
while true do
 game.Lighting:SetMinutesAfterMidnight(minutesAfterMidnight)
 minutesAfterMidnight = minutesAfterMidnight + 15
 wait(15)
end
if ClockTime == 13 then 
    ClockTime = 1
if not ClockTime == 13 then do
    ClockTime = 9
    end
end
0
What is not working on this? Jo_Bot 67 — 6y

1 answer

Log in to vote
0
Answered by
Simnico99 206 Moderation Voter
5 years ago
Edited 5 years ago

I had a script that was working for 24h system

wait(0.5)

local speed = 2.184

local hour = 20
local second = 0
local minute = 0


for i = 1, math.huge do
    for i = 0, 59 do
        minute = i
        game.Lighting.TimeOfDay = hour ..":"..i..":".. second
        wait(0)
        for g = 0, 59/speed do
            game.Lighting.TimeOfDay = hour ..":"..minute..":".. g*speed
            wait(0)
        end 
    end
        if Hour >= 11 then
          print(hour.." AM")
        else
          print(hour.." PM")
        end
    hour = hour + 1 
    wait()
end



0
so i tested it and when it hit 13 it didn't turn to 1 AM. DDM_DD 6 — 5y
Ad

Answer this question