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
brickRedA = game.Workspace:WaitForChild("RED") brickRedB = game.Workspace:WaitForChild("RED2") brickWhiteA = game.Workspace:WaitForChild("WHITE") brickWhiteB = game.Workspace:WaitForChild("WHITE2") game.Lighting.Changed:connect(function() if game.Lighting.TimeOfDay >= "18:00:00" then brickRedA.Material = "Neon" brickRedB.Material = "Neon" brickWhiteA.Material = "Neon" brickWhiteB.Material = "Neon" elseif game.Lighting.TimeOfDay <= "05:00:00" then brickRedA.Material = "Concrete" brickRedB.Material = "Concrete" brickWhiteA.Material = "Concrete" brickWhiteB.Material = "Concrete" end end)
You did spell white incorrectly, so that may be the issue. Also, I wasn't sure if you wanted neon at night so right now it's set to neon in the day time I believe. If it's not working then just reply and I'll see. I'm currently in school and have no access to ROBLOX so I cannot test things.