06:00:00 is not a valid Lua expression (why would it be? What would it mean)?
TimeOfDay is a string. You can compare strings:
if `game.Lighting.TimeOfDay > "06:00:00" then
However, this is probably not what you want.
If you look up the Lighting sevice you can read what you can use to do this.
Note that there's a GetMinutesAfterMidnight
We can use that:
local minutes = game.Lighting:GetMinutesAfterMidnight()
if minutes > 6 * 60 then
else
end
As LordDragonZord pointed out, this will only happen once.
We could put this in a while loop to make it just look constantly:
function update()
local minutes = game.Lighting:GetMinutesAfterMidnight()
if minutes > 6 * 60 then
else
end
end
while wait() do
update()
end
Or we could use the Changed event on the Lighting -- since we only need to adapt when the time has changed, we can use that fact (this probably lets ROBLOX do much less work)
function update()
local minutes = game.Lighting:GetMinutesAfterMidnight()
if minutes > 6 * 60 then
else
end
end
game.Lighting.Changed:connect(update)
2 comments
==is not the same as=. Nor does this do the same thing -- they wanted>. The time won't necessarily hit exactly every minute, so just==is not sufficient.@Blue, it's a typo. I meant 2 "="s.