I think I'm starting to get the hang of scripting, but for some reason, the brick wont change colors. Please help
if game.Lighting.TimeOfDay >= "18:00:00" then script.Parent.BrickColor = BrickColor.new("Yellow") elseif game.Lighting.TimeOfDay >= "6:00:00" then script.Parent.BrickColor = BrickColor.new("Really Black") end
Neither Yellow nor Really Black are colors, there's Really yellow or New Yeller as well as Really black. (The capitalisation is key)
If you're checking the time of day, you may want to put the code into a function
using the Changed
event to check the current TimeOfDay, when it changes.
You could write this as:
game.Lighting.Changed:connect(function() if game.Lighting.TimeOfDay >= "18:00:00" then script.Parent.BrickColor = BrickColor.new("Really yellow") elseif game.Lighting.TimeOfDay >= "6:00:00" then script.Parent.BrickColor = BrickColor.new("Really black") end end)