local part = script.Parent part.BrickColor = BrickColor.new("Institutional white") while true do wait(0.1) local timeoday = game.Lighting.ClockTime if timeoday > 17.6 or timeoday < 6.4 then part.Color = BrickColor.new("Institutional white") else part.Color = BrickColor.new("Really black") end
So here I want to make a brick color change when it's between 17.6 and 6.4. BUt it refuses to work. Why is tha?
The problem here is you are using 'or' instead of 'and' in your if statement.
Right now, the if statement is basically checking if it's higher than 17.6 or lower than 6.4.
If you want to check between the times, also do note a better way to do this is to use :GetMinutesAfterMidnight().
local part = script.Parent part.BrickColor = BrickColor.new("Institutional white") while true do wait(.1) if game.Lightning:GetMinutesAfterMidnight() > 17.6 * 60 and game.Lightning:GetMinutesAfterMidnight() > 6.4* 60 then part.Color = BrickColor.new("Institutional white") else part.Color = BrickColor.new("Really black") end end
Old question, but in case anyone comes across this...
Your output window should be showing an error something like:
"invalid argument #3 (Color3 expected, got BrickColor)"
because part.Color needs a Color3 data type, but BrickColor.new returns a BrickColor data type.
To fix this, you need to grab the '.Color' property out of the BrickColor, so it should look like this:
part.Color = BrickColor.new("Really black").Color
Then you're assigning a Color3 to a Color3.
(Also, in the cloud9josh response above, the problem is people keep saying Light-NING when it should be Light-ING).