Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Why is the neon not turning into Concrete, then at night turning back to Neon?

Asked by 9 years ago

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!

01local brickred1 = game.Workspace.("RED")
02local brickred2 = game.Workspace.("RED2")
03local brickwhite1 = game.Workspace.("WHITE")
04local brickwhite2 = game.Workspace.("WHIT2")
05 
06 
07 while wait() do 
08  local lighting = game:GetService("Lighting")
09   if lighting.TimeOfDay >= "18:00:00" then
10    --This is where the bricks will start to change in material
11   brickred1.Material = "Neon"
12   brickred2.Material = "Neon"
13   brickwhite1.Material = "Neon"
14   brickwhite2.Material = "Neon"
15 
View all 37 lines...

1 answer

Log in to vote
1
Answered by
Acheo 230 Moderation Voter
9 years ago
01brickRedA = game.Workspace:WaitForChild("RED")
02brickRedB = game.Workspace:WaitForChild("RED2")
03brickWhiteA = game.Workspace:WaitForChild("WHITE")
04brickWhiteB = game.Workspace:WaitForChild("WHITE2")
05 
06game.Lighting.Changed:connect(function()
07if game.Lighting.TimeOfDay >= "18:00:00" then
08brickRedA.Material = "Neon"
09brickRedB.Material = "Neon"
10brickWhiteA.Material = "Neon"
11brickWhiteB.Material = "Neon"
12 
13elseif game.Lighting.TimeOfDay <= "05:00:00" then
14brickRedA.Material = "Concrete"
15brickRedB.Material = "Concrete"
16brickWhiteA.Material = "Concrete"
17brickWhiteB.Material = "Concrete"
18end
19end)

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.

0
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). Spongocardo 1991 — 9y
0
I thought so, I was in school at the time. Acheo 230 — 9y
0
So does this mean the script won't work? VirtualFlying 55 — 9y
0
Pretty much, I can make one now if you'd like. Acheo 230 — 9y
Ad

Answer this question