Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Normal Time and how to fix the script?

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

1 comment

0

What is not working on this?

1 answer

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



1 comment

0

so i tested it and when it hit 13 it didn't turn to 1 AM.

This discussion is preserved as it was. New answers, comments, and votes are closed.