I'm looking to implement a feature where in the evening, the colour of the game is inverted (using invert) and to do this I'm checking if datetime.hour >= 20. My code looks like this..
on load do night = false if datetime.hour >= 20 then invert night = true end end on update do if night == true then if datetime.hour < 20 then invert night = false end end end
However, every time the player move or acts, the invert is toggled regardless of time. I'm not sure if there's an issue in my logic that I'm not seeing, or if the web player doesn't work great with datetime?