I want to disable global shadows at night and enable it at the morning.
while true do end wait() if game.Lighting.TimeOfDay == "06:30:00" then end game.Lighting.GlobalShadows = true if game.Lighting.ClockTime == "18:00:00" then game.Lighting.GlobalShadows = false end
Hello, TheLondiux!
I've found lots of errors on your script:
1 - Use end
to close a block of code, like a while
, if
, or any other code blocks that you need to close
2 - You don't need to place the then on the next line, it just makes your code harder to read
3 - If the object at game.Lighting.TimeOfDay
is a value, you should add a .Value
to gets it's value...
while true do -- Loop Starts here wait() if game.Lighting.TimeOfDay == 06.5 then -- 6:30 -- First IF starts here game.Lighting.GlobalShadows = true end -- First IF ends here if game.Lighting.ClockTime == 18 then -- 18 -- Second IF starts here game.Lighting.GlobalShadows = false end -- Second IF ends here end -- Loop ends here
Also, Scripting Helpers is not a place where you place a random script and we give you the answer, please post something that make sense with the question
Hope this helps
Good Luck with your games
Is this what you want to do?
Im new to scripting but here you go
while wait(1) do warn("OKASD") if game.Lighting.TimeOfDay == 6.5 then --"06:30:00" game.Lighting.GlobalShadows = true print("GlobShadows On") elseif game.Lighting.ClockTime == 18 then --"18:00:00" game.Lighting.GlobalShadows = false print("GlobShadows Off") end end
You can delete the (print) lines thats for when you add your time system i am guessing