I have Crazyman32's Day/Night script and so I made this script, when it's night these bricks will turn neon and during day to concrete, but it isn't working. Help!
local brickred1 = game.Workspace.("RED")
local brickred2 = game.Workspace.("RED2")
local brickwhite1 = game.Workspace.("WHITE")
local brickwhite2 = game.Workspace.("WHIT2")
while wait() do
local lighting = game:GetService("Lighting")
if lighting.TimeOfDay >= "18:00:00" then
--This is where the bricks will start to change in material
brickred1.Material = "Neon"
brickred2.Material = "Neon"
brickwhite1.Material = "Neon"
brickwhite2.Material = "Neon"
else
if lighting.TimeOfDay <= "05:00:00" then
--This is where the bricks will go back to concrete because it's daytime
brickred1.Material = "Concrete"
brickred2.Material = "Concrete"
brickwhite1.Material = "Concrete"
brickwhite2.Material = "Concrete"
--Right here is the code that checks if anything is not working
--To check if it broke or not, just press F9 and go through each of the tabs
if lighting.TimeOfDay <= "05:00:00" and brickred1.Material == "Concrete" then
local val = Instance.new("NumberValue",script.Parent)
val.Value = val.Value + 1
if val.Value + 1 then
print("looping + 1")
if not val.Value + 1 then
print("looping - 1 and it broke.")
end
end
end
end

4 comments
You can't check if a string is lower than or greater than (or equal to) another string as you're doing in lines 7 and 13. You have to use the GetMinutesFromMidnight method of Lighting and then convert hours to minutes (hour * 60). You can then compare the minutes after midnight to the hour (converted to minutes).
I thought so, I was in school at the time.
So does this mean the script won't work?
Pretty much, I can make one now if you'd like.