So I'm trying to make a GUI that displays the time using the "GetMinutesAfterMidnight()" line. I have this, but it isn't working. I just get a script timeout.
local timeCheck = game.Lighting:GetMinutesAfterMidnight() while true do if timeCheck < (1 * 60) then script.Parent.Text = "12 AM" else if timeCheck < (2 * 60) and timeCheck > 59 then script.Parent.Text = "1 AM" end end end -- then I add extra of the above going from 12AM - 11PM
This might have something to do with the "else" tag, but I'm not sure.
Just add a wait(). Your program is timing out because the "while true do" loop is running many times per second.
local timeCheck = game.Lighting:GetMinutesAfterMidnight() while true do wait() -- add a time if you chose if timeCheck < (1 * 60) then script.Parent.Text = "12 AM" else if timeCheck < (2 * 60) and timeCheck > 59 then script.Parent.Text = "1 AM" end end end -- then I add extra of the above going from 12AM - 11PM
If this doesn't work, please tell me.