For some reason my clock time goes from something like 12:35 to 12:369 and this causes other scripts to mess up.
Here is my TimeCycle script
local Time = 0.1
local TimeChange = 0.01
while wait (Time) do
game.Lighting.ClockTime = game.Lighting.ClockTime + TimeChange
end
And is there a better way to go about checking the time:
local UI = script.Parent
local Frame = UI:WaitForChild("Frame")
local TimeOfDay = Frame:WaitForChild("TimeOfDay")
local WhatToDo = Frame:WaitForChild("WhatToDo")
game:GetService("Lighting"):GetPropertyChangedSignal("ClockTime"):Connect(function()
local clocktime = game:GetService("Lighting").ClockTime
if clocktime == 7 then
UI.Enabled = true
TimeOfDay.Text = "Breakfast"
WhatToDo.Text = "Go to the cafeteria to eat!"
local Info = TweenInfo.new(1)
local TimeOfDayShown = game:GetService("TweenService"):Create(TimeOfDay,Info,{TextTransparency=0})
local TimeOfDayHidden = game:GetService("TweenService"):Create(TimeOfDay,Info,{TextTransparency=1})
local WhatToDoShown = game:GetService("TweenService"):Create(WhatToDo,Info,{TextTransparency=0})
local WhatToDoHidden = game:GetService("TweenService"):Create(WhatToDo,Info,{TextTransparency=1})
TimeOfDayShown:Play()
wait(0.5)
WhatToDoShown:Play()
wait(3)
WhatToDoHidden:Play()
wait(0.5)
TimeOfDayHidden:Play()
wait(1)
TimeOfDay.Text = ""
WhatToDo.Text = ""
UI.Enabled = false
end
end)