game.Lighting.TimeOfDay.Changed:connect(function() local Time = game.Lighting.TimeOfDay if Time == "18:00:00" then print("ITS 18!") elseif Time == "6:00:00" then print("ITS 6") end end)
What's Wrong with this script?
game.Lighting.Changed:connect(function() local time = game.Lighting:GetMinutesAfterMidnight() if time == 1080 then print"It's 6 pm!" elseif time == 360 then print"It's 6 am!" end end)
game.Lighting.Changed:connect(function(property) if property == game.Lighting.TimeOfDay then if game.Lighting.TimeOfDay == "18:00:00" then print("ITS 18!") elseif game.Lighting.TimeOfDay == "6:00:00" then print("ITS 6") end end end)
You dingus! you can't used the changed event on a specific property, it's meant for instances. Although it returns the property of the instance that was changed. so if we check if the property was TimeOfDay that changed, then we could successfully do the print.